/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DORMS.java
 *
 * Created on Oct 9, 2012, 9:57:24 AM
 */

import com.mysql.jdbc.Connection;
import java.lang.Object;
import java.sql.*;
import java.text.DateFormat;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author William
 */
public class DORMS extends javax.swing.JFrame {

    
        
    private Map<Integer, Student> studentListMap = new TreeMap<Integer, Student>();
    Connection conn;
    Statement stmt = null;
    Statement stmt2 = null;
    Statement stmt3 = null;
    private School school = new School();

    /** Creates new form DORMS */
    @SuppressWarnings("OverridableMethodCallInConstructor")
    public DORMS() {
        initComponents();
        connect();
        staffLoginDialog.pack();
        staffLoginDialog.setVisible(true);
        staffLoginDialog.requestFocus();
            
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    
    private void clearAddStudentDialog(){
        addStudentID.setText("");
        addStudentLoginName.setText("");
        addStudentPassword.setText("");
        addStudentFirstName.setText("");
        addStudentLastName.setText("");
        addStudentGender.setSelectedIndex(0);
        addStudentGradClass.setText("");
        
    }
    
    private void clearEditStudentDialog(){
        editStudentID.setText("");
        editStudentFirstName.setText("");
        editStudentLastName.setText("");
        editStudentGender.setSelectedIndex(0);
        editStudentGradClass.setText("");
        editStudentStatus.setSelectedIndex(0);
        
    }
    
    private void clearEditBuildingDialog(){
        
        editBuildingID.setText("");
        editBuildingName.setText("");
        editBuildingType.setSelectedIndex(0);
        editBuildingManagerID.setText("");
        editBuildingDescriptionField.setText("");
        
    
}  
    private void clearAddBuildingDialog(){
        addBuildingName.setText("");
        addBuildingType.setSelectedIndex(0);
        addBuildingManagerID.setText("");
        addBuildingDescriptionField.setText("");
        
    
}  
    
    
    private void clearEditRoomDialog(){
        
        editRoomID.setText("");
        editRoomBuildingID.setText("");
        editRoomFloor.setText("");
        editRoomNumber.setText("");
        editRoomGender.setSelectedIndex(0);
        editRoomType.setSelectedIndex(0);
        editRoomAvail.setSelectedIndex(1);
        editRoomDescription.setText("");
        
    
}  
    private void clearAddRoomDialog(){
        addRoomFloor.setText("");
        addRoomNumber.setText("");
        addRoomGender.setSelectedIndex(0);
        addRoomType.setSelectedIndex(0);
        addRoomAvail.setSelectedIndex(1);
        addRoomDescription.setText("");
        
    
} 
    
    private void clearViewRequestDialog(){
        
        viewRequestID.setText("");
        viewRequestStudentID.setText("");
        viewRequestStatus.setText("");
        viewRequestType.setText("");
        viewRequestYear.setText("");
        viewRequestReason.setText("");
        viewRequestIdealRoom.setText("");
        

    }
    
    
    private void clearAssignmentDialog(){
        assignmentYearCombo.setSelectedIndex(1);
        forTerm1.setSelected(false);
        forTerm2.setSelected(false);
        forTerm3.setSelected(false);
        assignmentStudentID.setText("");
        assignmentRoomID.setText("");
        unAssignedStudents.setListData(new Object[0]);
        unAssignedRooms.setListData(new Object[0]);
    }
    
    
    private void clearCreateStudentStaff(){
        newStudentStaffUsername.setText("");
        newStudentStaffPassword.setText("");
        newStudentStaffBuilding.setText("");
    }
    
    private void clearCreateStaff(){
        newStaffUsername.setText("");
        newStaffPassword.setText("");
        
    }
    
    private void clearSurveyDialog(){
        surveyStudentID.setText("");
        surveyStudentName.setText("");
        surveyYear.setText("");
        surveyDateSubmitted.setText("");
        surveyBedtime.setText("");
        surveyNeatness.setText("");
        surveyComments.setText("");
    
    }
    
    private void clearRegistrationDialog(){
        registrationYear.setText("");
        registrationStudentID.setText("");
        registrationStudentName.setText("");
        registrationDateSubmitted.setText("");
        registrationTerms.setText("");
        registrationSignature.setText("");
    }
    
    private void clearLoginDialog(){
        staffLoginUsername.setText("");
        staffLoginPassword.setText("");
    }
    
    private boolean login(String username, String password){
        if(Staff.logIn(username, password, conn))
            return true;
        else
            return false; 
    }
    
    
    
    private void populateHousingSetup(int type){
        //populate room lists
        availableList.setListData(school.getAvailableRooms(type).toArray());
        unavailableList.setListData(school.getUnavailableRooms(type).toArray());

        //populate the building filter combobox
        Building dummy = new Building("All Buildings", 1, 0, "");
        
        ArrayList<Building> display = new ArrayList<Building>();
        display.add(dummy);
        display.addAll(school.getBuildings());
        unavailableBuilding.setModel(new DefaultComboBoxModel(display.toArray()));
        availableBuilding.setModel(new DefaultComboBoxModel(display.toArray()));        
        
    }
    
    
    
    private void setViewStudentDialog(Student studentEditting){
        editStudentID.setText(String.valueOf(studentEditting.studentID));
        editStudentFirstName.setText(studentEditting.firstName);
        editStudentLastName.setText(studentEditting.lastName);
        editStudentGender.setSelectedIndex(studentEditting.gender);
        editStudentGradClass.setText(String.valueOf(studentEditting.gradClass));
        editStudentStatus.setSelectedIndex(studentEditting.status);
        editStudentLotteryNumber.setText(String.valueOf(studentEditting.lotteryNumber));
        if(studentEditting.getSurvey() == null)
            viewSurvey.setEnabled(false);
        else
            viewSurvey.setEnabled(true);
        ArrayList<String> registrations = new ArrayList<String>();
        String dummy = "Registration";
        registrations.add(dummy);
        registrations.addAll(studentEditting.getRegistrationsInYear());
        studentRegistrationsCombo.setModel(new DefaultComboBoxModel(registrations.toArray()));
        editStudentDialog.pack();
        editStudentDialog.setVisible(true);
        
    }
    
    private void setViewBuildlingDialog(Building buildingEditting){
        editBuildingID.setText(String.valueOf(buildingEditting.buildingID));
        editBuildingName.setText(buildingEditting.buildingName);
        editBuildingType.setSelectedIndex(buildingEditting.type);
        editBuildingManagerID.setText(String.valueOf(buildingEditting.managerID));
        editBuildingDescriptionField.setText(buildingEditting.description);
        
        buildingList.setListData(school.getBuildings().toArray());
        editBuildingRoomList.setListData(buildingEditting.getRooms().toArray());
        
        editBuildingDialog.pack();
        editBuildingDialog.setVisible(true);
    
    }
    private void setViewRoomDialog(Room roomEditting){
        editRoomID.setText(String.valueOf(roomEditting.roomID));
        editRoomBuildingID.setText(String.valueOf(roomEditting.buildingID));
        editRoomFloor.setText(String.valueOf(roomEditting.floor));
        editRoomNumber.setText(String.valueOf(roomEditting.roomNumber));
        editRoomGender.setSelectedIndex(roomEditting.gender);
        editRoomType.setSelectedIndex(roomEditting.type);
        int availability;
        if(roomEditting.isAvail)
            availability = 1;
        else
            availability = 0;
        editRoomAvail.setSelectedIndex(availability);
        int forFreshman;
        if(roomEditting.forFreshman)
            forFreshman = 1;
        else
            forFreshman = 0;
        editRoomFreshman.setSelectedIndex(forFreshman);
        
        editRoomDescription.setText(roomEditting.description);
        
        editRoomDialog.pack();
        editRoomDialog.setVisible(true);
    }
    
    
    private void setViewRequestDialog(Request requestViewing){
                
        viewRequestID.setText(String.valueOf(requestViewing.requestID));
        viewRequestStudentID.setText(String.valueOf(requestViewing.studentID));
        viewRequestStatus.setText(requestViewing.getStatusAsString());
        viewRequestType.setText(requestViewing.getTypeAsString());
        viewRequestYear.setText(String.valueOf(requestViewing.year));
        viewRequestReason.setText(requestViewing.reason);
        viewRequestIdealRoom.setText(requestViewing.idealRoom);

        if(requestViewing.status == requestViewing.STATUS_NEW)
            requestViewing.mark(requestViewing.STATUS_REVIEWING);
        
        viewRequestDialog.pack();
        viewRequestDialog.setVisible(true);
        notificationList.setListData(school.setUpNotifications());
    }
    
    private void setRegistrationDialog(int studentID, int year){
        Student student = new Student(studentID,conn);
        Registration register = new Registration(studentID, year, conn);
        registrationYear.setText(String.valueOf(year));
        registrationStudentID.setText(String.valueOf(student.studentID));
        registrationStudentName.setText(student.firstName + " " + student.lastName);
        DateFormat submittedFormat = new SimpleDateFormat("MM/dd/yy HH:mm");
        registrationDateSubmitted.setText(submittedFormat.format(register.dateSubmitted.getTime()));
        String terms = "";
        if(register.onCampusTerm1)
            terms += "Term 1";
        if(register.onCampusTerm2){
            if(!terms.equals(""))
                terms += ", ";
            terms += "Term 2";
        }
        if (register.onCampusTerm3){
            if(!terms.equals(""))
                terms += ", ";
            terms += "Term 3";
        }
        registrationTerms.setText(terms);
        registrationSignature.setText(register.signature);
    
    }
    
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        addStudentDialog = new javax.swing.JDialog();
        jLabel1 = new javax.swing.JLabel();
        addStudentLastName = new javax.swing.JTextField();
        addStudentGender = new javax.swing.JComboBox();
        addStudentFirstName = new javax.swing.JTextField();
        addStudentID = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        addStudentCancel = new javax.swing.JButton();
        addStudentSubmit = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        addStudentLoginName = new javax.swing.JTextField();
        addStudentGradClass = new javax.swing.JTextField();
        addStudentPassword = new javax.swing.JPasswordField();
        editStudentDialog = new javax.swing.JDialog();
        jLabel10 = new javax.swing.JLabel();
        editStudentLastName = new javax.swing.JTextField();
        editStudentGender = new javax.swing.JComboBox();
        editStudentFirstName = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        editStudentCancel = new javax.swing.JButton();
        viewSurvey = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        editStudentGradClass = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        editStudentStatus = new javax.swing.JComboBox();
        jLabel19 = new javax.swing.JLabel();
        editStudentLotteryNumber = new javax.swing.JLabel();
        editStudentSubmit = new javax.swing.JButton();
        studentRegistrationsCombo = new javax.swing.JComboBox();
        editStudentID = new javax.swing.JLabel();
        viewStudentViewAssignmentsButton = new javax.swing.JButton();
        addBuildingDialog = new javax.swing.JDialog();
        jLabel13 = new javax.swing.JLabel();
        addBuildingName = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        addBuildingType = new javax.swing.JComboBox();
        addBuildingManagerID = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        addBuildingDescription = new javax.swing.JScrollPane();
        addBuildingDescriptionField = new javax.swing.JTextArea();
        jLabel22 = new javax.swing.JLabel();
        addBuildingCancelButton = new javax.swing.JButton();
        addBuildingSubmitButton = new javax.swing.JButton();
        editBuildingDialog = new javax.swing.JDialog();
        jLabel23 = new javax.swing.JLabel();
        editBuildingName = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        editBuildingType = new javax.swing.JComboBox();
        editBuildingManagerID = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        editBuildingDescription = new javax.swing.JScrollPane();
        editBuildingDescriptionField = new javax.swing.JTextArea();
        jLabel27 = new javax.swing.JLabel();
        editBuildingCancelButton = new javax.swing.JButton();
        editBuildingSubmitButton = new javax.swing.JButton();
        jLabel28 = new javax.swing.JLabel();
        editBuildingID = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        editBuildingRoomList = new javax.swing.JList();
        editBuildingAddRoomButton = new javax.swing.JButton();
        editBuildingViewRoomButton = new javax.swing.JButton();
        editBuildingRemoveRoomButton = new javax.swing.JButton();
        jLabel29 = new javax.swing.JLabel();
        addRoomDialog = new javax.swing.JDialog();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        addRoomNumber = new javax.swing.JTextField();
        addRoomGender = new javax.swing.JComboBox();
        addRoomDescription = new javax.swing.JTextField();
        addRoomType = new javax.swing.JComboBox();
        addRoomCancelButton = new javax.swing.JButton();
        addRoomSubmit = new javax.swing.JButton();
        jLabel44 = new javax.swing.JLabel();
        addRoomFloor = new javax.swing.JTextField();
        jLabel47 = new javax.swing.JLabel();
        addRoomAvail = new javax.swing.JComboBox();
        jLabel74 = new javax.swing.JLabel();
        addRoomForFreshman = new javax.swing.JComboBox();
        editRoomDialog = new javax.swing.JDialog();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        editRoomNumber = new javax.swing.JTextField();
        editRoomGender = new javax.swing.JComboBox();
        editRoomDescription = new javax.swing.JTextField();
        editRoomType = new javax.swing.JComboBox();
        editRoomCancelButton = new javax.swing.JButton();
        editRoomSubmit = new javax.swing.JButton();
        jLabel42 = new javax.swing.JLabel();
        editRoomID = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        editRoomFloor = new javax.swing.JTextField();
        editRoomBuildingID = new javax.swing.JTextField();
        jLabel48 = new javax.swing.JLabel();
        editRoomAvail = new javax.swing.JComboBox();
        editRoomFreshman = new javax.swing.JComboBox();
        jLabel75 = new javax.swing.JLabel();
        viewRequestDialog = new javax.swing.JDialog();
        jLabel43 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        viewRequestID = new javax.swing.JLabel();
        jLabel50 = new javax.swing.JLabel();
        viewRequestStudentID = new javax.swing.JLabel();
        jLabel51 = new javax.swing.JLabel();
        viewRequestType = new javax.swing.JLabel();
        jLabel52 = new javax.swing.JLabel();
        viewRequestStatus = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        viewRequestYear = new javax.swing.JLabel();
        jLabel54 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        viewRequestReason = new javax.swing.JTextArea();
        jLabel55 = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        viewRequestIdealRoom = new javax.swing.JTextArea();
        viewRequestCancel = new javax.swing.JButton();
        viewRequestDisapprove = new javax.swing.JButton();
        viewRequestApprove = new javax.swing.JButton();
        makeAssignmentsDialog = new javax.swing.JDialog();
        jLabel56 = new javax.swing.JLabel();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        unAssignedStudents = new javax.swing.JList();
        jScrollPane8 = new javax.swing.JScrollPane();
        unAssignedRooms = new javax.swing.JList();
        assignmentsCancelButton = new javax.swing.JButton();
        assignmentsDialogMakeAssignment = new javax.swing.JButton();
        jLabel59 = new javax.swing.JLabel();
        assignmentYearCombo = new javax.swing.JComboBox();
        forTerm1 = new javax.swing.JCheckBox();
        forTerm3 = new javax.swing.JCheckBox();
        forTerm2 = new javax.swing.JCheckBox();
        assignmentFilterYearTerm = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        assignmentStudentID = new javax.swing.JTextField();
        jLabel76 = new javax.swing.JLabel();
        assignmentRoomID = new javax.swing.JTextField();
        jLabel77 = new javax.swing.JLabel();
        assignmentStudentType = new javax.swing.JComboBox();
        assignmentBuilding = new javax.swing.JComboBox();
        jLabel79 = new javax.swing.JLabel();
        jLabel80 = new javax.swing.JLabel();
        staffLoginDialog = new javax.swing.JDialog();
        jLabel61 = new javax.swing.JLabel();
        staffLoginUsername = new javax.swing.JTextField();
        jLabel62 = new javax.swing.JLabel();
        jLabel63 = new javax.swing.JLabel();
        staffLoginCancelButton = new javax.swing.JButton();
        StaffLoginLoginButton = new javax.swing.JButton();
        staffLoginPassword = new javax.swing.JPasswordField();
        matchRoommatesDialog = new javax.swing.JDialog();
        jLabel64 = new javax.swing.JLabel();
        jScrollPane9 = new javax.swing.JScrollPane();
        matchRoommateStudentList = new javax.swing.JList();
        jLabel65 = new javax.swing.JLabel();
        jScrollPane10 = new javax.swing.JScrollPane();
        matchRoommatesSuggestionsList = new javax.swing.JList();
        jLabel66 = new javax.swing.JLabel();
        matchRoommatesMakeSuggestionsButton = new javax.swing.JButton();
        matchRoommatesMakeAssignmentButton = new javax.swing.JButton();
        matchRoommatesCancelButton = new javax.swing.JButton();
        matchRoommatesFilterField = new javax.swing.JTextField();
        matchRoommatesFilterButton = new javax.swing.JButton();
        viewRegistrationDialog = new javax.swing.JDialog();
        jLabel78 = new javax.swing.JLabel();
        registrationClose = new javax.swing.JButton();
        registrationYear = new javax.swing.JLabel();
        registrationStudentName = new javax.swing.JLabel();
        registrationDateSubmitted = new javax.swing.JLabel();
        registrationStudentID = new javax.swing.JLabel();
        jLabel104 = new javax.swing.JLabel();
        jLabel107 = new javax.swing.JLabel();
        jLabel108 = new javax.swing.JLabel();
        jLabel109 = new javax.swing.JLabel();
        jLabel110 = new javax.swing.JLabel();
        registrationTerms = new javax.swing.JLabel();
        jLabel111 = new javax.swing.JLabel();
        registrationSignature = new javax.swing.JLabel();
        viewSurveyDialog = new javax.swing.JDialog();
        jLabel88 = new javax.swing.JLabel();
        jLabel89 = new javax.swing.JLabel();
        jLabel90 = new javax.swing.JLabel();
        jLabel91 = new javax.swing.JLabel();
        jScrollPane14 = new javax.swing.JScrollPane();
        surveyComments = new javax.swing.JTextArea();
        jLabel92 = new javax.swing.JLabel();
        jLabel93 = new javax.swing.JLabel();
        surveyClose = new javax.swing.JButton();
        jLabel94 = new javax.swing.JLabel();
        surveyStudentID = new javax.swing.JLabel();
        surveyStudentName = new javax.swing.JLabel();
        surveyDateSubmitted = new javax.swing.JLabel();
        surveyBedtime = new javax.swing.JLabel();
        surveyYear = new javax.swing.JLabel();
        jLabel112 = new javax.swing.JLabel();
        surveyNeatness = new javax.swing.JLabel();
        assignedRoomsToStudent = new javax.swing.JDialog();
        jLabel105 = new javax.swing.JLabel();
        jScrollPane16 = new javax.swing.JScrollPane();
        assignmentTable = new javax.swing.JTable();
        disassociateStudentButton = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        viewRoomAssignmentsStudentNameLabel = new javax.swing.JLabel();
        NotificationsPane = new javax.swing.JTabbedPane();
        notificationPane = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        notificationList = new javax.swing.JList();
        requestMarkNew = new javax.swing.JButton();
        viewRequest = new javax.swing.JButton();
        studentPane = new javax.swing.JPanel();
        addStudentButton = new javax.swing.JButton();
        editStudentButton = new javax.swing.JButton();
        removeStudentButton = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        studentList = new javax.swing.JList();
        matchStudentButton = new javax.swing.JButton();
        buildingPane = new javax.swing.JPanel();
        viewBuildingButton = new javax.swing.JButton();
        deleteBuildingButton = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        buildingList = new javax.swing.JList();
        addBuildingButton = new javax.swing.JButton();
        makeAssingmentsButton = new javax.swing.JButton();
        AdminPane = new javax.swing.JPanel();
        jLabel60 = new javax.swing.JLabel();
        newStudentStaffUsername = new javax.swing.JTextField();
        createStudentStaff = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        newStudentStaffBuilding = new javax.swing.JTextField();
        jLabel95 = new javax.swing.JLabel();
        jLabel96 = new javax.swing.JLabel();
        jLabel97 = new javax.swing.JLabel();
        jLabel99 = new javax.swing.JLabel();
        jLabel100 = new javax.swing.JLabel();
        newStaffUsername = new javax.swing.JTextField();
        jLabel101 = new javax.swing.JLabel();
        createStaff = new javax.swing.JButton();
        newStudentStaffPassword = new javax.swing.JPasswordField();
        newStaffPassword = new javax.swing.JPasswordField();
        SetupSelectionPane = new javax.swing.JPanel();
        jLabel67 = new javax.swing.JLabel();
        selectionRoomType = new javax.swing.JComboBox();
        jScrollPane11 = new javax.swing.JScrollPane();
        unavailableList = new javax.swing.JList();
        jLabel68 = new javax.swing.JLabel();
        jLabel69 = new javax.swing.JLabel();
        jScrollPane12 = new javax.swing.JScrollPane();
        availableList = new javax.swing.JList();
        jLabel70 = new javax.swing.JLabel();
        jLabel71 = new javax.swing.JLabel();
        housingSelectionSetupTabCompleteButton = new javax.swing.JButton();
        fieldDate = new javax.swing.JFormattedTextField();
        fieldStartTime = new javax.swing.JFormattedTextField();
        jLabel102 = new javax.swing.JLabel();
        fieldEndTime = new javax.swing.JFormattedTextField();
        unavailableBuilding = new javax.swing.JComboBox();
        availableBuilding = new javax.swing.JComboBox();
        jLabel72 = new javax.swing.JLabel();
        jLabel73 = new javax.swing.JLabel();
        jLabel98 = new javax.swing.JLabel();
        selectionYear = new javax.swing.JComboBox();
        jLabel103 = new javax.swing.JLabel();

        jLabel1.setText("Add Student");

        addStudentLastName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentLastNameActionPerformed(evt);
            }
        });

        addStudentGender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Male", "Female", "Transgender" }));
        addStudentGender.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentGenderActionPerformed(evt);
            }
        });

        addStudentFirstName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentFirstNameActionPerformed(evt);
            }
        });

        addStudentID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentIDActionPerformed(evt);
            }
        });

        jLabel2.setText("Gender:");

        addStudentCancel.setText("Cancel");
        addStudentCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentCancelActionPerformed(evt);
            }
        });

        addStudentSubmit.setText("Submit");
        addStudentSubmit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentSubmitActionPerformed(evt);
            }
        });

        jLabel4.setText("Lawrence ID:");

        jLabel5.setText("Login Name:");

        jLabel6.setText("Password:");

        jLabel7.setText("First Name:");

        jLabel8.setText("Last Name:");

        jLabel9.setText("Grad Class:");

        addStudentLoginName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentLoginNameActionPerformed(evt);
            }
        });

        addStudentGradClass.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentGradClassActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout addStudentDialogLayout = new org.jdesktop.layout.GroupLayout(addStudentDialog.getContentPane());
        addStudentDialog.getContentPane().setLayout(addStudentDialogLayout);
        addStudentDialogLayout.setHorizontalGroup(
            addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(addStudentDialogLayout.createSequentialGroup()
                .add(68, 68, 68)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jLabel7)
                    .add(jLabel4)
                    .add(jLabel6)
                    .add(addStudentDialogLayout.createSequentialGroup()
                        .add(jLabel8)
                        .add(1, 1, 1))
                    .add(jLabel5)
                    .add(jLabel9)
                    .add(jLabel2))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(addStudentDialogLayout.createSequentialGroup()
                        .add(jLabel1)
                        .addContainerGap())
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, addStudentDialogLayout.createSequentialGroup()
                        .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, addStudentGradClass, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, addStudentGender, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, addStudentFirstName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, addStudentLoginName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, addStudentID, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, addStudentLastName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, addStudentPassword, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE))
                        .add(81, 81, 81))))
            .add(addStudentDialogLayout.createSequentialGroup()
                .add(105, 105, 105)
                .add(addStudentCancel)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(addStudentSubmit)
                .addContainerGap(174, Short.MAX_VALUE))
        );
        addStudentDialogLayout.setVerticalGroup(
            addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(addStudentDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel1)
                .add(30, 30, 30)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel4)
                    .add(addStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(addStudentLoginName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel5))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel6)
                    .add(addStudentPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel7)
                    .add(addStudentFirstName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(22, 22, 22)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel8)
                    .add(addStudentLastName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(addStudentGender, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel9)
                    .add(addStudentGradClass, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(addStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(addStudentSubmit)
                    .add(addStudentCancel))
                .add(113, 113, 113))
        );

        jLabel10.setText("View/Edit Student");

        editStudentLastName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editStudentLastNameActionPerformed(evt);
            }
        });

        editStudentGender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Male", "Female", "Transgender" }));
        editStudentGender.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editStudentGenderActionPerformed(evt);
            }
        });

        editStudentFirstName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editStudentFirstNameActionPerformed(evt);
            }
        });

        jLabel11.setText("Gender:");

        editStudentCancel.setText("Cancel");
        editStudentCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editStudentCancelActionPerformed(evt);
            }
        });

        viewSurvey.setText("Survey");
        viewSurvey.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewSurveyActionPerformed(evt);
            }
        });

        jLabel12.setText("Lawrence ID:");

        jLabel15.setText("First Name:");

        jLabel16.setText("Last Name:");

        jLabel17.setText("Grad Class:");

        editStudentGradClass.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editStudentGradClassActionPerformed(evt);
            }
        });

        jLabel18.setText("Status:");

        editStudentStatus.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Regular", "New", "Medical", "Offcampus" }));
        editStudentStatus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editStudentStatusActionPerformed(evt);
            }
        });

        jLabel19.setText("Lottery Number:");

        editStudentSubmit.setText("Save");
        editStudentSubmit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editStudentSubmitActionPerformed(evt);
            }
        });

        studentRegistrationsCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Registrations" }));
        studentRegistrationsCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studentRegistrationsComboActionPerformed(evt);
            }
        });

        viewStudentViewAssignmentsButton.setText("Room Assignments");
        viewStudentViewAssignmentsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewStudentViewAssignmentsButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout editStudentDialogLayout = new org.jdesktop.layout.GroupLayout(editStudentDialog.getContentPane());
        editStudentDialog.getContentPane().setLayout(editStudentDialogLayout);
        editStudentDialogLayout.setHorizontalGroup(
            editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, editStudentDialogLayout.createSequentialGroup()
                .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(editStudentDialogLayout.createSequentialGroup()
                        .add(68, 68, 68)
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jLabel11)
                            .add(jLabel12)
                            .add(jLabel15)
                            .add(jLabel16)))
                    .add(editStudentDialogLayout.createSequentialGroup()
                        .add(40, 40, 40)
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jLabel18)
                            .add(jLabel19)
                            .add(jLabel17))))
                .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(editStudentDialogLayout.createSequentialGroup()
                        .add(19, 19, 19)
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(editStudentLotteryNumber, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 107, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(editStudentGender, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(editStudentLastName)
                            .add(editStudentFirstName)
                            .add(editStudentCancel)
                            .add(editStudentStatus, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(editStudentGradClass)))
                    .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                        .add(editStudentDialogLayout.createSequentialGroup()
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(editStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 83, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jLabel10)))
                .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(editStudentDialogLayout.createSequentialGroup()
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(editStudentSubmit))
                    .add(editStudentDialogLayout.createSequentialGroup()
                        .add(36, 36, 36)
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(viewStudentViewAssignmentsButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(studentRegistrationsCombo, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(viewSurvey))))
                .addContainerGap(47, Short.MAX_VALUE))
        );
        editStudentDialogLayout.setVerticalGroup(
            editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(editStudentDialogLayout.createSequentialGroup()
                .add(32, 32, 32)
                .add(jLabel10)
                .add(18, 18, 18)
                .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel12)
                    .add(editStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(editStudentDialogLayout.createSequentialGroup()
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(editStudentFirstName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel15))
                        .add(18, 18, 18)
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(editStudentLastName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel16))
                        .add(18, 18, 18)
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel11)
                            .add(editStudentGender, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(18, 18, 18)
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel17)
                            .add(editStudentGradClass, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel18)
                            .add(editStudentStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(17, 17, 17)
                        .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel19)
                            .add(editStudentLotteryNumber, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(editStudentDialogLayout.createSequentialGroup()
                        .add(viewSurvey)
                        .add(18, 18, 18)
                        .add(studentRegistrationsCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(18, 18, 18)
                        .add(viewStudentViewAssignmentsButton)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 33, Short.MAX_VALUE)
                .add(editStudentDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(editStudentCancel)
                    .add(editStudentSubmit))
                .add(28, 28, 28))
        );

        jLabel13.setText("Add Building Dialog");

        jLabel14.setText("Buliding Name");

        jLabel20.setText("Building Type");

        addBuildingType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Dorm", "Formal", "Theme" }));

        addBuildingManagerID.setText("0");

        jLabel21.setText("Building Manager ID");

        addBuildingDescriptionField.setColumns(20);
        addBuildingDescriptionField.setLineWrap(true);
        addBuildingDescriptionField.setRows(5);
        addBuildingDescription.setViewportView(addBuildingDescriptionField);

        jLabel22.setText("Building Description");

        addBuildingCancelButton.setText("Cancel");
        addBuildingCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addBuildingCancelButtonActionPerformed(evt);
            }
        });

        addBuildingSubmitButton.setText("Submit");
        addBuildingSubmitButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addBuildingSubmitButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout addBuildingDialogLayout = new org.jdesktop.layout.GroupLayout(addBuildingDialog.getContentPane());
        addBuildingDialog.getContentPane().setLayout(addBuildingDialogLayout);
        addBuildingDialogLayout.setHorizontalGroup(
            addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(addBuildingDialogLayout.createSequentialGroup()
                .add(addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(addBuildingDialogLayout.createSequentialGroup()
                        .add(133, 133, 133)
                        .add(jLabel13))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, addBuildingDialogLayout.createSequentialGroup()
                        .add(addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(addBuildingDialogLayout.createSequentialGroup()
                                .addContainerGap()
                                .add(jLabel22))
                            .add(addBuildingDialogLayout.createSequentialGroup()
                                .add(26, 26, 26)
                                .add(addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel14)
                                    .add(jLabel20)
                                    .add(jLabel21))))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 18, Short.MAX_VALUE)
                        .add(addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(addBuildingManagerID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 101, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(addBuildingType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 119, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(addBuildingName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(addBuildingDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
            .add(org.jdesktop.layout.GroupLayout.TRAILING, addBuildingDialogLayout.createSequentialGroup()
                .addContainerGap(101, Short.MAX_VALUE)
                .add(addBuildingCancelButton)
                .add(48, 48, 48)
                .add(addBuildingSubmitButton)
                .add(111, 111, 111))
        );
        addBuildingDialogLayout.setVerticalGroup(
            addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(addBuildingDialogLayout.createSequentialGroup()
                .add(20, 20, 20)
                .add(jLabel13)
                .add(24, 24, 24)
                .add(addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jLabel14)
                    .add(addBuildingName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel20)
                    .add(addBuildingType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel21)
                    .add(addBuildingManagerID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(addBuildingDialogLayout.createSequentialGroup()
                        .add(18, 18, 18)
                        .add(addBuildingDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(addBuildingDialogLayout.createSequentialGroup()
                        .add(29, 29, 29)
                        .add(jLabel22)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 51, Short.MAX_VALUE)
                .add(addBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(addBuildingSubmitButton)
                    .add(addBuildingCancelButton))
                .add(45, 45, 45))
        );

        jLabel23.setText("Edit Building");

        jLabel24.setText("Buliding Name");

        jLabel25.setText("Building Type");

        editBuildingType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Dorm", "Formal", "Theme" }));

        jLabel26.setText("Building Manager ID");

        editBuildingDescriptionField.setColumns(20);
        editBuildingDescriptionField.setLineWrap(true);
        editBuildingDescriptionField.setRows(5);
        editBuildingDescriptionField.setWrapStyleWord(true);
        editBuildingDescription.setViewportView(editBuildingDescriptionField);

        jLabel27.setText("Building Description");

        editBuildingCancelButton.setText("Cancel");
        editBuildingCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editBuildingCancelButtonActionPerformed(evt);
            }
        });

        editBuildingSubmitButton.setText("Submit");
        editBuildingSubmitButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editBuildingSubmitButtonActionPerformed(evt);
            }
        });

        jLabel28.setText("Buliding ID");

        editBuildingRoomList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        editBuildingRoomList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                editBuildingRoomListMouseClicked(evt);
            }
        });
        jScrollPane4.setViewportView(editBuildingRoomList);

        editBuildingAddRoomButton.setText("Add Room");
        editBuildingAddRoomButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editBuildingAddRoomButtonActionPerformed(evt);
            }
        });

        editBuildingViewRoomButton.setText("View/Edit Room");
        editBuildingViewRoomButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editBuildingViewRoomButtonActionPerformed(evt);
            }
        });

        editBuildingRemoveRoomButton.setText("Remove Room");
        editBuildingRemoveRoomButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editBuildingRemoveRoomButtonActionPerformed(evt);
            }
        });

        jLabel29.setText("Rooms");

        org.jdesktop.layout.GroupLayout editBuildingDialogLayout = new org.jdesktop.layout.GroupLayout(editBuildingDialog.getContentPane());
        editBuildingDialog.getContentPane().setLayout(editBuildingDialogLayout);
        editBuildingDialogLayout.setHorizontalGroup(
            editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(editBuildingDialogLayout.createSequentialGroup()
                .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(editBuildingDialogLayout.createSequentialGroup()
                        .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(editBuildingDialogLayout.createSequentialGroup()
                                .add(26, 26, 26)
                                .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(jLabel27)
                                    .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                        .add(jLabel25)
                                        .add(jLabel26))))
                            .add(editBuildingDialogLayout.createSequentialGroup()
                                .add(26, 26, 26)
                                .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel24)
                                    .add(jLabel28))))
                        .add(18, 18, 18)
                        .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(editBuildingManagerID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 101, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(editBuildingType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 119, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(editBuildingName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(editBuildingID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 88, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(editBuildingDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(editBuildingDialogLayout.createSequentialGroup()
                        .add(93, 93, 93)
                        .add(editBuildingCancelButton)
                        .add(38, 38, 38)
                        .add(editBuildingSubmitButton))
                    .add(editBuildingDialogLayout.createSequentialGroup()
                        .add(162, 162, 162)
                        .add(jLabel23)))
                .add(9, 9, 9)
                .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(editBuildingDialogLayout.createSequentialGroup()
                        .add(172, 172, 172)
                        .add(jLabel29)
                        .addContainerGap())
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, editBuildingDialogLayout.createSequentialGroup()
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                            .add(editBuildingRemoveRoomButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(editBuildingViewRoomButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(editBuildingAddRoomButton))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jScrollPane4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 233, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(37, 37, 37))))
        );
        editBuildingDialogLayout.setVerticalGroup(
            editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(editBuildingDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(editBuildingDialogLayout.createSequentialGroup()
                        .add(jLabel23)
                        .add(27, 27, 27)
                        .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(editBuildingDialogLayout.createSequentialGroup()
                                .add(editBuildingID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(editBuildingName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(editBuildingDialogLayout.createSequentialGroup()
                                .add(jLabel28)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jLabel24)))
                        .add(18, 18, 18)
                        .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(editBuildingType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel25))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(editBuildingManagerID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel26))
                        .add(18, 18, 18)
                        .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel27)
                            .add(editBuildingDescription, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE))
                        .add(18, 18, 18)
                        .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(editBuildingSubmitButton)
                            .add(editBuildingCancelButton)))
                    .add(editBuildingDialogLayout.createSequentialGroup()
                        .add(12, 12, 12)
                        .add(jLabel29)
                        .add(18, 18, 18)
                        .add(editBuildingDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(editBuildingDialogLayout.createSequentialGroup()
                                .add(editBuildingAddRoomButton)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(editBuildingViewRoomButton)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(editBuildingRemoveRoomButton))
                            .add(jScrollPane4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 304, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        jLabel30.setText("Add Room");

        jLabel31.setText("Room Number");

        jLabel32.setText("Room Type");

        jLabel33.setText("Description");

        jLabel35.setText("Gender");

        addRoomNumber.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addRoomNumberActionPerformed(evt);
            }
        });

        addRoomGender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Male", "Female", "Coed" }));

        addRoomType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Single", "Double", "Triple", "Quad" }));
        addRoomType.setSelectedIndex(1);

        addRoomCancelButton.setText("Cancel");
        addRoomCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addRoomCancelButtonActionPerformed(evt);
            }
        });

        addRoomSubmit.setText("Submit");
        addRoomSubmit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addRoomSubmitActionPerformed(evt);
            }
        });

        jLabel44.setText("Floor");

        addRoomFloor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addRoomFloorActionPerformed(evt);
            }
        });

        jLabel47.setText("Available for students?");

        addRoomAvail.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No", "Yes" }));
        addRoomAvail.setSelectedIndex(1);

        jLabel74.setText("Freshman room?");

        addRoomForFreshman.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No", "Yes" }));
        addRoomForFreshman.setSelectedIndex(0);

        org.jdesktop.layout.GroupLayout addRoomDialogLayout = new org.jdesktop.layout.GroupLayout(addRoomDialog.getContentPane());
        addRoomDialog.getContentPane().setLayout(addRoomDialogLayout);
        addRoomDialogLayout.setHorizontalGroup(
            addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(addRoomDialogLayout.createSequentialGroup()
                .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, addRoomDialogLayout.createSequentialGroup()
                        .add(21, 21, 21)
                        .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(addRoomCancelButton)
                            .add(jLabel33))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 47, Short.MAX_VALUE)
                        .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(addRoomDialogLayout.createSequentialGroup()
                                .add(addRoomSubmit)
                                .add(8, 8, 8))
                            .add(addRoomDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 149, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(addRoomDialogLayout.createSequentialGroup()
                        .add(115, 115, 115)
                        .add(jLabel30))
                    .add(addRoomDialogLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(jLabel34)
                        .add(11, 11, 11)
                        .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel44)
                            .add(addRoomDialogLayout.createSequentialGroup()
                                .add(108, 108, 108)
                                .add(addRoomFloor, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
                            .add(addRoomDialogLayout.createSequentialGroup()
                                .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jLabel31)
                                    .add(jLabel32))
                                .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(addRoomDialogLayout.createSequentialGroup()
                                        .add(21, 21, 21)
                                        .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(addRoomGender, 0, 161, Short.MAX_VALUE)
                                            .add(addRoomType, 0, 161, Short.MAX_VALUE)))
                                    .add(addRoomDialogLayout.createSequentialGroup()
                                        .add(18, 18, 18)
                                        .add(addRoomNumber, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))))
                            .add(addRoomDialogLayout.createSequentialGroup()
                                .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel47)
                                    .add(jLabel74))
                                .add(51, 51, 51)
                                .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(addRoomForFreshman, 0, 78, Short.MAX_VALUE)
                                    .add(addRoomAvail, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
                .addContainerGap())
        );
        addRoomDialogLayout.setVerticalGroup(
            addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(addRoomDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel30)
                .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(addRoomDialogLayout.createSequentialGroup()
                        .add(124, 124, 124)
                        .add(jLabel34))
                    .add(addRoomDialogLayout.createSequentialGroup()
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel44)
                            .add(addRoomFloor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel31)
                            .add(addRoomNumber, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel32)
                            .add(addRoomType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel35)
                            .add(addRoomGender, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(3, 3, 3)
                        .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(addRoomAvail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel47))))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel74)
                    .add(addRoomForFreshman, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 12, Short.MAX_VALUE)
                .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(addRoomDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel33))
                .add(18, 18, 18)
                .add(addRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(addRoomSubmit)
                    .add(addRoomCancelButton))
                .addContainerGap())
        );

        jLabel36.setText("View/Edit Room");

        jLabel37.setText("Room Number");

        jLabel38.setText("Room Type");

        jLabel39.setText("Description");

        jLabel41.setText("Gender");

        editRoomNumber.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editRoomNumberActionPerformed(evt);
            }
        });

        editRoomGender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Male", "Female", "Coed" }));
        editRoomGender.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editRoomGenderActionPerformed(evt);
            }
        });

        editRoomDescription.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editRoomDescriptionActionPerformed(evt);
            }
        });

        editRoomType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Single", "Double", "Triple", "Quad" }));

        editRoomCancelButton.setText("Cancel");
        editRoomCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editRoomCancelButtonActionPerformed(evt);
            }
        });

        editRoomSubmit.setText("Submit");
        editRoomSubmit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editRoomSubmitActionPerformed(evt);
            }
        });

        jLabel42.setText("Room ID");

        jLabel45.setText("Building ID");

        jLabel46.setText("Floor");

        editRoomFloor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editRoomFloorActionPerformed(evt);
            }
        });

        editRoomBuildingID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editRoomBuildingIDActionPerformed(evt);
            }
        });

        jLabel48.setText("Availble for students?");

        editRoomAvail.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No", "Yes" }));
        editRoomAvail.setSelectedIndex(1);

        editRoomFreshman.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No", "Yes" }));
        editRoomFreshman.setSelectedIndex(1);

        jLabel75.setText("Freshman room?");

        org.jdesktop.layout.GroupLayout editRoomDialogLayout = new org.jdesktop.layout.GroupLayout(editRoomDialog.getContentPane());
        editRoomDialog.getContentPane().setLayout(editRoomDialogLayout);
        editRoomDialogLayout.setHorizontalGroup(
            editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(editRoomDialogLayout.createSequentialGroup()
                .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(editRoomDialogLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(jLabel40)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel39)
                            .add(jLabel48)
                            .add(jLabel75)
                            .add(jLabel38)
                            .add(jLabel41, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel37)
                            .add(jLabel46)
                            .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                .add(editRoomDialogLayout.createSequentialGroup()
                                    .add(jLabel45)
                                    .add(18, 18, 18))
                                .add(org.jdesktop.layout.GroupLayout.TRAILING, editRoomDialogLayout.createSequentialGroup()
                                    .add(jLabel42)
                                    .add(33, 33, 33))))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(editRoomDialogLayout.createSequentialGroup()
                                .add(editRoomID, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)
                                .add(8, 8, 8))
                            .add(editRoomFloor, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                            .add(editRoomType, 0, 139, Short.MAX_VALUE)
                            .add(editRoomDescription, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                            .add(editRoomFreshman, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(editRoomGender, 0, 139, Short.MAX_VALUE)
                            .add(editRoomAvail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(editRoomNumber, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                            .add(editRoomBuildingID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 139, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(editRoomDialogLayout.createSequentialGroup()
                        .add(45, 45, 45)
                        .add(editRoomCancelButton)
                        .add(26, 26, 26)
                        .add(editRoomSubmit))
                    .add(editRoomDialogLayout.createSequentialGroup()
                        .add(121, 121, 121)
                        .add(jLabel36)))
                .addContainerGap())
        );
        editRoomDialogLayout.setVerticalGroup(
            editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(editRoomDialogLayout.createSequentialGroup()
                .add(28, 28, 28)
                .add(jLabel36)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(editRoomDialogLayout.createSequentialGroup()
                        .add(124, 124, 124)
                        .add(jLabel40)
                        .add(108, 108, 108)
                        .add(editRoomAvail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(editRoomDialogLayout.createSequentialGroup()
                        .add(30, 30, 30)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(editRoomID, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 16, Short.MAX_VALUE)
                            .add(jLabel42))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel45)
                            .add(editRoomBuildingID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel46)
                            .add(editRoomFloor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel37)
                            .add(editRoomNumber, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel38)
                            .add(editRoomType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel41)
                            .add(editRoomGender, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(20, 20, 20)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(editRoomDialogLayout.createSequentialGroup()
                                .add(jLabel48)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jLabel75)
                                .add(18, 18, 18))
                            .add(editRoomDialogLayout.createSequentialGroup()
                                .add(editRoomFreshman, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(18, 18, 18)))
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel39)
                            .add(editRoomDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(18, 18, 18)
                        .add(editRoomDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(editRoomCancelButton)
                            .add(editRoomSubmit))
                        .add(12, 12, 12))))
        );

        jLabel43.setText("View Request");

        jLabel49.setText("Request ID");

        jLabel50.setText("Student ID");

        jLabel51.setText("Type");

        jLabel52.setText("Status");

        jLabel53.setText("Year");

        jLabel54.setText("Reason for request");

        viewRequestReason.setColumns(20);
        viewRequestReason.setEditable(false);
        viewRequestReason.setLineWrap(true);
        viewRequestReason.setRows(5);
        jScrollPane5.setViewportView(viewRequestReason);

        jLabel55.setText("Ideal Rom Situation");

        viewRequestIdealRoom.setColumns(20);
        viewRequestIdealRoom.setEditable(false);
        viewRequestIdealRoom.setLineWrap(true);
        viewRequestIdealRoom.setRows(5);
        jScrollPane6.setViewportView(viewRequestIdealRoom);

        viewRequestCancel.setText("Cancel");
        viewRequestCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewRequestCancelActionPerformed(evt);
            }
        });

        viewRequestDisapprove.setText("Disapprove");
        viewRequestDisapprove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewRequestDisapproveActionPerformed(evt);
            }
        });

        viewRequestApprove.setText("Approve");
        viewRequestApprove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewRequestApproveActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout viewRequestDialogLayout = new org.jdesktop.layout.GroupLayout(viewRequestDialog.getContentPane());
        viewRequestDialog.getContentPane().setLayout(viewRequestDialogLayout);
        viewRequestDialogLayout.setHorizontalGroup(
            viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(viewRequestDialogLayout.createSequentialGroup()
                .add(viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(viewRequestDialogLayout.createSequentialGroup()
                        .add(145, 145, 145)
                        .add(jLabel43))
                    .add(viewRequestDialogLayout.createSequentialGroup()
                        .add(57, 57, 57)
                        .add(viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(viewRequestDialogLayout.createSequentialGroup()
                                .add(jLabel50)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 185, Short.MAX_VALUE)
                                .add(viewRequestStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(viewRequestDialogLayout.createSequentialGroup()
                                .add(jLabel49)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .add(viewRequestID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(viewRequestDialogLayout.createSequentialGroup()
                                .add(jLabel51)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 221, Short.MAX_VALUE)
                                .add(viewRequestType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(viewRequestDialogLayout.createSequentialGroup()
                                .add(jLabel52)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 212, Short.MAX_VALUE)
                                .add(viewRequestStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(viewRequestDialogLayout.createSequentialGroup()
                                .add(jLabel53)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 224, Short.MAX_VALUE)
                                .add(viewRequestYear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jLabel54)
                            .add(jScrollPane5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 270, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel55)
                            .add(jScrollPane6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 270, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(viewRequestDialogLayout.createSequentialGroup()
                                .add(viewRequestCancel)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(viewRequestDisapprove)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(viewRequestApprove)))))
                .addContainerGap(22, Short.MAX_VALUE))
        );
        viewRequestDialogLayout.setVerticalGroup(
            viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(viewRequestDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel43)
                .add(18, 18, 18)
                .add(viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel49)
                    .add(viewRequestID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel50)
                    .add(viewRequestStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel51)
                    .add(viewRequestType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel52)
                    .add(viewRequestStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel53)
                    .add(viewRequestYear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jLabel54)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jScrollPane5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(jLabel55)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jScrollPane6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(viewRequestDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(viewRequestCancel)
                    .add(viewRequestDisapprove)
                    .add(viewRequestApprove))
                .addContainerGap(29, Short.MAX_VALUE))
        );

        jLabel56.setText("Assignments");

        jLabel57.setText("Students registered but not assigned a room:");

        jLabel58.setText("Rooms not occupied:");

        unAssignedStudents.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                unAssignedStudentsMouseClicked(evt);
            }
        });
        jScrollPane7.setViewportView(unAssignedStudents);

        unAssignedRooms.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                unAssignedRoomsMouseClicked(evt);
            }
        });
        jScrollPane8.setViewportView(unAssignedRooms);

        assignmentsCancelButton.setText("Cancel");
        assignmentsCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                assignmentsCancelButtonActionPerformed(evt);
            }
        });

        assignmentsDialogMakeAssignment.setText("Make Assignment");
        assignmentsDialogMakeAssignment.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                assignmentsDialogMakeAssignmentActionPerformed(evt);
            }
        });

        jLabel59.setText("Terms:");

        assignmentYearCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2011", "2012", "2013" }));
        assignmentYearCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                assignmentYearComboActionPerformed(evt);
            }
        });

        forTerm1.setSelected(true);
        forTerm1.setText("Term 1");
        forTerm1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                forTerm1ActionPerformed(evt);
            }
        });

        forTerm3.setSelected(true);
        forTerm3.setText("Term 3");
        forTerm3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                forTerm3ActionPerformed(evt);
            }
        });

        forTerm2.setSelected(true);
        forTerm2.setText("Term 2");
        forTerm2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                forTerm2ActionPerformed(evt);
            }
        });

        assignmentFilterYearTerm.setText("Filter");
        assignmentFilterYearTerm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                assignmentFilterYearTermActionPerformed(evt);
            }
        });

        jLabel76.setText("Student ID:");

        assignmentRoomID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                assignmentRoomIDActionPerformed(evt);
            }
        });

        jLabel77.setText("Room ID: ");

        assignmentStudentType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "New Student", "Returning" }));
        assignmentStudentType.setSelectedIndex(1);

        assignmentBuilding.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All buildings" }));

        jLabel79.setText("Student:");

        jLabel80.setText("Building:");

        org.jdesktop.layout.GroupLayout makeAssignmentsDialogLayout = new org.jdesktop.layout.GroupLayout(makeAssignmentsDialog.getContentPane());
        makeAssignmentsDialog.getContentPane().setLayout(makeAssignmentsDialogLayout);
        makeAssignmentsDialogLayout.setHorizontalGroup(
            makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(makeAssignmentsDialogLayout.createSequentialGroup()
                .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(makeAssignmentsDialogLayout.createSequentialGroup()
                        .add(293, 293, 293)
                        .add(jLabel56))
                    .add(makeAssignmentsDialogLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel59)
                            .add(jLabel79)
                            .add(jLabel80))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(makeAssignmentsDialogLayout.createSequentialGroup()
                                .add(assignmentYearCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(18, 18, 18)
                                .add(forTerm1))
                            .add(assignmentStudentType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(assignmentBuilding, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 159, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(27, 27, 27)
                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(makeAssignmentsDialogLayout.createSequentialGroup()
                                .add(forTerm2)
                                .add(36, 36, 36)
                                .add(forTerm3))
                            .add(makeAssignmentsDialogLayout.createSequentialGroup()
                                .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(makeAssignmentsDialogLayout.createSequentialGroup()
                                        .add(jLabel77)
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                        .add(assignmentRoomID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 113, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(org.jdesktop.layout.GroupLayout.LEADING, makeAssignmentsDialogLayout.createSequentialGroup()
                                        .add(jLabel76)
                                        .add(14, 14, 14)
                                        .add(assignmentStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 104, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                                .add(37, 37, 37)
                                .add(assignmentFilterYearTerm))))
                    .add(makeAssignmentsDialogLayout.createSequentialGroup()
                        .add(17, 17, 17)
                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 701, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(makeAssignmentsDialogLayout.createSequentialGroup()
                                .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(makeAssignmentsDialogLayout.createSequentialGroup()
                                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(jScrollPane7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 279, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(jLabel57))
                                        .add(15, 15, 15))
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, makeAssignmentsDialogLayout.createSequentialGroup()
                                        .add(assignmentsCancelButton)
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)))
                                .add(26, 26, 26)
                                .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel58)
                                    .add(jScrollPane8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 308, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(assignmentsDialogMakeAssignment))
                                .add(61, 61, 61)))))
                .addContainerGap(42, Short.MAX_VALUE))
        );
        makeAssignmentsDialogLayout.setVerticalGroup(
            makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(makeAssignmentsDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel56)
                .add(13, 13, 13)
                .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel59)
                    .add(assignmentYearCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(forTerm2)
                    .add(forTerm3)
                    .add(forTerm1))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(makeAssignmentsDialogLayout.createSequentialGroup()
                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(assignmentStudentType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel79))
                        .add(18, 18, 18)
                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(assignmentBuilding, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel80)))
                    .add(makeAssignmentsDialogLayout.createSequentialGroup()
                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel76)
                            .add(assignmentStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(18, 18, 18)
                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(assignmentRoomID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel77)
                            .add(assignmentFilterYearTerm))))
                .add(19, 19, 19)
                .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(makeAssignmentsDialogLayout.createSequentialGroup()
                        .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel57)
                            .add(jLabel58))
                        .add(18, 18, 18)
                        .add(jScrollPane7))
                    .add(makeAssignmentsDialogLayout.createSequentialGroup()
                        .add(34, 34, 34)
                        .add(jScrollPane8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 199, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .add(18, 18, 18)
                .add(makeAssignmentsDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(assignmentsCancelButton)
                    .add(assignmentsDialogMakeAssignment))
                .addContainerGap())
        );

        staffLoginDialog.setAlwaysOnTop(true);
        staffLoginDialog.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                staffLoginDialogWindowClosed(evt);
            }
        });

        jLabel61.setText("Staff Login:");

        staffLoginUsername.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                staffLoginUsernameActionPerformed(evt);
            }
        });

        jLabel62.setText("Username:");

        jLabel63.setText("Password:");

        staffLoginCancelButton.setText("Cancel");
        staffLoginCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                staffLoginCancelButtonActionPerformed(evt);
            }
        });

        StaffLoginLoginButton.setText("Login");
        StaffLoginLoginButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                StaffLoginLoginButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout staffLoginDialogLayout = new org.jdesktop.layout.GroupLayout(staffLoginDialog.getContentPane());
        staffLoginDialog.getContentPane().setLayout(staffLoginDialogLayout);
        staffLoginDialogLayout.setHorizontalGroup(
            staffLoginDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(staffLoginDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(staffLoginDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(staffLoginDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(staffLoginDialogLayout.createSequentialGroup()
                            .add(staffLoginCancelButton)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 53, Short.MAX_VALUE)
                            .add(StaffLoginLoginButton))
                        .add(staffLoginDialogLayout.createSequentialGroup()
                            .add(staffLoginDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                .add(jLabel63)
                                .add(jLabel62))
                            .add(18, 18, 18)
                            .add(staffLoginDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                                .add(staffLoginPassword, 0, 0, Short.MAX_VALUE)
                                .add(staffLoginUsername, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE))
                            .add(13, 13, 13)))
                    .add(staffLoginDialogLayout.createSequentialGroup()
                        .add(75, 75, 75)
                        .add(jLabel61)))
                .addContainerGap(30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
        );
        staffLoginDialogLayout.setVerticalGroup(
            staffLoginDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(staffLoginDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel61)
                .add(27, 27, 27)
                .add(staffLoginDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(staffLoginUsername, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel62))
                .add(18, 18, 18)
                .add(staffLoginDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(staffLoginPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel63))
                .add(18, 18, 18)
                .add(staffLoginDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(staffLoginCancelButton)
                    .add(StaffLoginLoginButton))
                .addContainerGap(39, Short.MAX_VALUE))
        );

        jLabel64.setText("Match Roommates");

        matchRoommateStudentList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane9.setViewportView(matchRoommateStudentList);

        jLabel65.setText("Filter by ID:");

        matchRoommatesSuggestionsList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "suggested 1", "suggested 2", "suggested 3" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane10.setViewportView(matchRoommatesSuggestionsList);

        jLabel66.setText("Suggested Roommates:");

        matchRoommatesMakeSuggestionsButton.setText("Make Suggestions");
        matchRoommatesMakeSuggestionsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                matchRoommatesMakeSuggestionsButtonActionPerformed(evt);
            }
        });

        matchRoommatesMakeAssignmentButton.setText("Make Assignment");

        matchRoommatesCancelButton.setText("Cancel");
        matchRoommatesCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                matchRoommatesCancelButtonActionPerformed(evt);
            }
        });

        matchRoommatesFilterButton.setText("Filter");
        matchRoommatesFilterButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                matchRoommatesFilterButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout matchRoommatesDialogLayout = new org.jdesktop.layout.GroupLayout(matchRoommatesDialog.getContentPane());
        matchRoommatesDialog.getContentPane().setLayout(matchRoommatesDialogLayout);
        matchRoommatesDialogLayout.setHorizontalGroup(
            matchRoommatesDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(matchRoommatesDialogLayout.createSequentialGroup()
                .add(matchRoommatesDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(matchRoommatesDialogLayout.createSequentialGroup()
                        .add(167, 167, 167)
                        .add(jLabel64))
                    .add(matchRoommatesDialogLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(matchRoommatesDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel65)
                            .add(matchRoommatesDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                                .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane9)
                                .add(org.jdesktop.layout.GroupLayout.LEADING, matchRoommatesDialogLayout.createSequentialGroup()
                                    .add(matchRoommatesFilterField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 107, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(1, 1, 1)
                                    .add(matchRoommatesFilterButton)))
                            .add(matchRoommatesMakeSuggestionsButton))
                        .add(59, 59, 59)
                        .add(matchRoommatesDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(matchRoommatesMakeAssignmentButton)
                            .add(matchRoommatesDialogLayout.createSequentialGroup()
                                .add(12, 12, 12)
                                .add(matchRoommatesDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel66)
                                    .add(jScrollPane10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 186, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
                    .add(matchRoommatesDialogLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(matchRoommatesCancelButton)))
                .addContainerGap(61, Short.MAX_VALUE))
        );
        matchRoommatesDialogLayout.setVerticalGroup(
            matchRoommatesDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(matchRoommatesDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel64)
                .add(matchRoommatesDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(matchRoommatesDialogLayout.createSequentialGroup()
                        .add(24, 24, 24)
                        .add(jLabel65)
                        .add(18, 18, 18)
                        .add(matchRoommatesDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(matchRoommatesFilterField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(matchRoommatesFilterButton))
                        .add(22, 22, 22)
                        .add(jScrollPane9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(30, 30, 30)
                        .add(matchRoommatesMakeSuggestionsButton))
                    .add(matchRoommatesDialogLayout.createSequentialGroup()
                        .add(33, 33, 33)
                        .add(jLabel66)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jScrollPane10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)
                        .add(30, 30, 30)
                        .add(matchRoommatesMakeAssignmentButton)))
                .add(18, 18, 18)
                .add(matchRoommatesCancelButton)
                .add(62, 62, 62))
        );

        jLabel78.setText("Student Registration");

        registrationClose.setText("Close");
        registrationClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                registrationCloseActionPerformed(evt);
            }
        });

        jLabel104.setText("Year: ");

        jLabel107.setText("Student Name:");

        jLabel108.setText("Date Submitted:");

        jLabel109.setText("Student ID:");

        jLabel110.setText("Terms:");

        jLabel111.setText("Signature:");

        org.jdesktop.layout.GroupLayout viewRegistrationDialogLayout = new org.jdesktop.layout.GroupLayout(viewRegistrationDialog.getContentPane());
        viewRegistrationDialog.getContentPane().setLayout(viewRegistrationDialogLayout);
        viewRegistrationDialogLayout.setHorizontalGroup(
            viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(viewRegistrationDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel108)
                    .add(jLabel109)
                    .add(jLabel104)
                    .add(jLabel107)
                    .add(jLabel110)
                    .add(jLabel111))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(viewRegistrationDialogLayout.createSequentialGroup()
                        .add(viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(registrationTerms, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .add(registrationDateSubmitted, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .add(registrationStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 65, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(registrationYear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 74, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(registrationStudentName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(62, 62, 62))
                    .add(viewRegistrationDialogLayout.createSequentialGroup()
                        .add(registrationSignature, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 105, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
            .add(viewRegistrationDialogLayout.createSequentialGroup()
                .add(72, 72, 72)
                .add(jLabel78)
                .addContainerGap(106, Short.MAX_VALUE))
            .add(viewRegistrationDialogLayout.createSequentialGroup()
                .add(101, 101, 101)
                .add(registrationClose)
                .addContainerGap(126, Short.MAX_VALUE))
        );
        viewRegistrationDialogLayout.setVerticalGroup(
            viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(viewRegistrationDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel78)
                .add(18, 18, 18)
                .add(viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel104)
                    .add(registrationYear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel109)
                    .add(registrationStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jLabel107)
                    .add(registrationStudentName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jLabel108)
                    .add(registrationDateSubmitted, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel110)
                    .add(registrationTerms, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewRegistrationDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel111)
                    .add(registrationSignature, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 31, Short.MAX_VALUE)
                .add(registrationClose)
                .add(25, 25, 25))
        );

        jLabel88.setText("Student ID:");

        jLabel89.setText("Date Submitted:");

        jLabel90.setText("Student Name:");

        jLabel91.setText("Year: ");

        surveyComments.setColumns(20);
        surveyComments.setEditable(false);
        surveyComments.setLineWrap(true);
        surveyComments.setRows(5);
        surveyComments.setWrapStyleWord(true);
        jScrollPane14.setViewportView(surveyComments);

        jLabel92.setText("Comments:");

        jLabel93.setFont(new java.awt.Font("Lucida Grande", 1, 18));
        jLabel93.setText("View Survey");

        surveyClose.setText("Close");
        surveyClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                surveyCloseActionPerformed(evt);
            }
        });

        jLabel94.setText("Bedtime:");

        jLabel112.setText("Neatness:");

        org.jdesktop.layout.GroupLayout viewSurveyDialogLayout = new org.jdesktop.layout.GroupLayout(viewSurveyDialog.getContentPane());
        viewSurveyDialog.getContentPane().setLayout(viewSurveyDialogLayout);
        viewSurveyDialogLayout.setHorizontalGroup(
            viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(viewSurveyDialogLayout.createSequentialGroup()
                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(viewSurveyDialogLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(jLabel92)
                        .add(18, 18, 18)
                        .add(jScrollPane14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 196, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(viewSurveyDialogLayout.createSequentialGroup()
                        .add(134, 134, 134)
                        .add(jLabel93))
                    .add(viewSurveyDialogLayout.createSequentialGroup()
                        .add(50, 50, 50)
                        .add(surveyClose, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 151, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(viewSurveyDialogLayout.createSequentialGroup()
                        .add(78, 78, 78)
                        .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(viewSurveyDialogLayout.createSequentialGroup()
                                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(jLabel90)
                                    .add(jLabel91)
                                    .add(jLabel88))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(surveyStudentName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                        .add(surveyStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 65, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .add(surveyYear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 74, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                            .add(viewSurveyDialogLayout.createSequentialGroup()
                                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(jLabel89)
                                    .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                        .add(jLabel112)
                                        .add(jLabel94)))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(surveyBedtime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(surveyDateSubmitted, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
                                    .add(surveyNeatness, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 104, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))))
                .add(70, 70, 70))
        );
        viewSurveyDialogLayout.setVerticalGroup(
            viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(viewSurveyDialogLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel93)
                .add(18, 18, 18)
                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel91)
                    .add(surveyYear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel88)
                    .add(surveyStudentID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jLabel90)
                    .add(surveyStudentName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jLabel89)
                    .add(surveyDateSubmitted, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel94, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(surveyBedtime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel112)
                    .add(surveyNeatness, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(viewSurveyDialogLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jScrollPane14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 108, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel92))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(surveyClose)
                .addContainerGap(27, Short.MAX_VALUE))
        );

        jLabel105.setText("Rooms Assigned to Student");

        assignmentTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Year", "Room", "Terms"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane16.setViewportView(assignmentTable);
        assignmentTable.getColumnModel().getColumn(0).setHeaderValue("Year");
        assignmentTable.getColumnModel().getColumn(1).setHeaderValue("Room");
        assignmentTable.getColumnModel().getColumn(2).setHeaderValue("Terms");

        disassociateStudentButton.setText("Disassociate");
        disassociateStudentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                disassociateStudentButtonActionPerformed(evt);
            }
        });

        jLabel3.setText("Student Name:");

        org.jdesktop.layout.GroupLayout assignedRoomsToStudentLayout = new org.jdesktop.layout.GroupLayout(assignedRoomsToStudent.getContentPane());
        assignedRoomsToStudent.getContentPane().setLayout(assignedRoomsToStudentLayout);
        assignedRoomsToStudentLayout.setHorizontalGroup(
            assignedRoomsToStudentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(assignedRoomsToStudentLayout.createSequentialGroup()
                .add(98, 98, 98)
                .add(jLabel105)
                .addContainerGap(104, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, assignedRoomsToStudentLayout.createSequentialGroup()
                .addContainerGap(32, Short.MAX_VALUE)
                .add(assignedRoomsToStudentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(assignedRoomsToStudentLayout.createSequentialGroup()
                        .add(jLabel3)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(viewRoomAssignmentsStudentNameLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE))
                    .add(jScrollPane16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 314, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(assignedRoomsToStudentLayout.createSequentialGroup()
                        .add(77, 77, 77)
                        .add(disassociateStudentButton)))
                .add(30, 30, 30))
        );
        assignedRoomsToStudentLayout.setVerticalGroup(
            assignedRoomsToStudentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, assignedRoomsToStudentLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel105)
                .add(25, 25, 25)
                .add(assignedRoomsToStudentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel3)
                    .add(viewRoomAssignmentsStudentNameLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 40, Short.MAX_VALUE)
                .add(jScrollPane16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 219, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(disassociateStudentButton)
                .addContainerGap())
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        notificationList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                notificationListMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(notificationList);

        requestMarkNew.setText("Mark New");
        requestMarkNew.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                requestMarkNewActionPerformed(evt);
            }
        });

        viewRequest.setText("View");
        viewRequest.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewRequestActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout notificationPaneLayout = new org.jdesktop.layout.GroupLayout(notificationPane);
        notificationPane.setLayout(notificationPaneLayout);
        notificationPaneLayout.setHorizontalGroup(
            notificationPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, notificationPaneLayout.createSequentialGroup()
                .addContainerGap(86, Short.MAX_VALUE)
                .add(notificationPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(viewRequest)
                    .add(requestMarkNew))
                .add(46, 46, 46)
                .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 250, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(98, 98, 98))
        );
        notificationPaneLayout.setVerticalGroup(
            notificationPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(notificationPaneLayout.createSequentialGroup()
                .addContainerGap()
                .add(notificationPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 247, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(notificationPaneLayout.createSequentialGroup()
                        .add(viewRequest)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(requestMarkNew)))
                .add(69, 69, 69))
        );

        NotificationsPane.addTab("Notifications", notificationPane);

        addStudentButton.setText("Add Student");
        addStudentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentButtonActionPerformed(evt);
            }
        });

        editStudentButton.setText("View/Edit Student");
        editStudentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editStudentButtonActionPerformed(evt);
            }
        });

        removeStudentButton.setText("Remove Student");
        removeStudentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeStudentButtonActionPerformed(evt);
            }
        });

        studentList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                studentListMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(studentList);

        matchStudentButton.setText("Match New Students");
        matchStudentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                matchStudentButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout studentPaneLayout = new org.jdesktop.layout.GroupLayout(studentPane);
        studentPane.setLayout(studentPaneLayout);
        studentPaneLayout.setHorizontalGroup(
            studentPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(studentPaneLayout.createSequentialGroup()
                .addContainerGap()
                .add(studentPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(editStudentButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(addStudentButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(removeStudentButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(matchStudentButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 181, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(41, 41, 41)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 325, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(22, Short.MAX_VALUE))
        );
        studentPaneLayout.setVerticalGroup(
            studentPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(studentPaneLayout.createSequentialGroup()
                .add(studentPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(studentPaneLayout.createSequentialGroup()
                        .add(51, 51, 51)
                        .add(addStudentButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(editStudentButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(removeStudentButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(matchStudentButton))
                    .add(studentPaneLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 269, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(36, Short.MAX_VALUE))
        );

        NotificationsPane.addTab("Student", studentPane);

        viewBuildingButton.setText("View/Edit Building");
        viewBuildingButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewBuildingButtonActionPerformed(evt);
            }
        });

        deleteBuildingButton.setText("Remove Building");
        deleteBuildingButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteBuildingButtonActionPerformed(evt);
            }
        });

        buildingList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                buildingListMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(buildingList);

        addBuildingButton.setText("Add Building");
        addBuildingButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addBuildingButtonActionPerformed(evt);
            }
        });

        makeAssingmentsButton.setText("Make Assignments");
        makeAssingmentsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                makeAssingmentsButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout buildingPaneLayout = new org.jdesktop.layout.GroupLayout(buildingPane);
        buildingPane.setLayout(buildingPaneLayout);
        buildingPaneLayout.setHorizontalGroup(
            buildingPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(buildingPaneLayout.createSequentialGroup()
                .add(buildingPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(addBuildingButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                    .add(viewBuildingButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                    .add(deleteBuildingButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                    .add(makeAssingmentsButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 172, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jScrollPane3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 361, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(51, 51, 51))
        );
        buildingPaneLayout.setVerticalGroup(
            buildingPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(buildingPaneLayout.createSequentialGroup()
                .addContainerGap()
                .add(buildingPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jScrollPane3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 268, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(buildingPaneLayout.createSequentialGroup()
                        .add(addBuildingButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(viewBuildingButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(deleteBuildingButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(makeAssingmentsButton)))
                .addContainerGap(37, Short.MAX_VALUE))
        );

        NotificationsPane.addTab("Building", buildingPane);

        jLabel60.setText("Add a student staff:");

        createStudentStaff.setText("Submit");
        createStudentStaff.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                createStudentStaffActionPerformed(evt);
            }
        });

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabel95.setText("Login Name:");

        jLabel96.setText("Password:");

        jLabel97.setText("Building Managing:");

        jLabel99.setText("Password:");

        jLabel100.setText("Login Name:");

        newStaffUsername.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newStaffUsernameActionPerformed(evt);
            }
        });

        jLabel101.setText("Add a full-time staff:");

        createStaff.setText("Submit");
        createStaff.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                createStaffActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout AdminPaneLayout = new org.jdesktop.layout.GroupLayout(AdminPane);
        AdminPane.setLayout(AdminPaneLayout);
        AdminPaneLayout.setHorizontalGroup(
            AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(AdminPaneLayout.createSequentialGroup()
                .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(AdminPaneLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(AdminPaneLayout.createSequentialGroup()
                                .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(jLabel97)
                                    .add(jLabel95)
                                    .add(jLabel96))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                                    .add(newStudentStaffBuilding)
                                    .add(newStudentStaffPassword)
                                    .add(newStudentStaffUsername, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)))
                            .add(AdminPaneLayout.createSequentialGroup()
                                .add(48, 48, 48)
                                .add(jLabel60))))
                    .add(AdminPaneLayout.createSequentialGroup()
                        .add(96, 96, 96)
                        .add(createStudentStaff)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jSeparator2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(AdminPaneLayout.createSequentialGroup()
                        .add(30, 30, 30)
                        .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jLabel100)
                            .add(jLabel99))
                        .add(18, 18, 18)
                        .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(newStaffPassword)
                            .add(newStaffUsername, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)))
                    .add(AdminPaneLayout.createSequentialGroup()
                        .add(74, 74, 74)
                        .add(createStaff))
                    .add(AdminPaneLayout.createSequentialGroup()
                        .add(59, 59, 59)
                        .add(jLabel101)))
                .addContainerGap(37, Short.MAX_VALUE))
        );
        AdminPaneLayout.setVerticalGroup(
            AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, AdminPaneLayout.createSequentialGroup()
                .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, AdminPaneLayout.createSequentialGroup()
                        .add(47, 47, 47)
                        .add(jLabel101)
                        .add(18, 18, 18)
                        .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(newStaffUsername, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel100))
                        .add(18, 18, 18)
                        .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel99, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(newStaffPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(62, 62, 62)
                        .add(createStaff))
                    .add(org.jdesktop.layout.GroupLayout.LEADING, AdminPaneLayout.createSequentialGroup()
                        .add(44, 44, 44)
                        .add(jLabel60)
                        .add(18, 18, 18)
                        .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel95)
                            .add(newStudentStaffUsername, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(18, 18, 18)
                        .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel96)
                            .add(newStudentStaffPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(AdminPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(newStudentStaffBuilding, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel97))
                        .add(23, 23, 23)
                        .add(createStudentStaff)))
                .add(79, 79, 79))
            .add(AdminPaneLayout.createSequentialGroup()
                .add(36, 36, 36)
                .add(jSeparator2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 197, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(92, Short.MAX_VALUE))
        );

        NotificationsPane.addTab("Administration", AdminPane);

        SetupSelectionPane.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                SetupSelectionPaneMouseClicked(evt);
            }
        });

        jLabel67.setText("Choose type of selection:");

        selectionRoomType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Single", "Double", "Triple/Quad/Suite" }));
        selectionRoomType.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                selectionRoomTypeActionPerformed(evt);
            }
        });

        unavailableList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Swing House 204", "Ormsby 103" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        unavailableList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                unavailableListMouseClicked(evt);
            }
        });
        jScrollPane11.setViewportView(unavailableList);

        jLabel68.setText("Unavailable Rooms:");

        jLabel69.setText("Available for selection:");

        availableList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Hiett 103" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        availableList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                availableListMouseClicked(evt);
            }
        });
        jScrollPane12.setViewportView(availableList);

        jLabel70.setText("Date:");

        jLabel71.setText("Start Time:");

        housingSelectionSetupTabCompleteButton.setText("Complete Setup");
        housingSelectionSetupTabCompleteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                housingSelectionSetupTabCompleteButtonActionPerformed(evt);
            }
        });

        fieldDate.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter(new java.text.SimpleDateFormat("MM/dd/yy"))));
        fieldDate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fieldDateActionPerformed(evt);
            }
        });

        fieldStartTime.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter(new java.text.SimpleDateFormat("hh:mm a"))));
        fieldStartTime.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fieldStartTimeActionPerformed(evt);
            }
        });

        jLabel102.setText("End Time:");

        fieldEndTime.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter(new java.text.SimpleDateFormat("hh:mm a"))));
        fieldEndTime.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fieldEndTimeActionPerformed(evt);
            }
        });

        unavailableBuilding.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All Buildings" }));
        unavailableBuilding.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                unavailableBuildingActionPerformed(evt);
            }
        });

        availableBuilding.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All Buildlings" }));
        availableBuilding.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                availableBuildingActionPerformed(evt);
            }
        });

        jLabel72.setText("Please review the list and edit room when necessary");

        jLabel73.setForeground(new java.awt.Color(0, 51, 153));
        jLabel73.setText("In HH:MM A/PM");

        jLabel98.setForeground(new java.awt.Color(0, 51, 153));
        jLabel98.setText("In MM/DD/YY");

        selectionYear.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2011", "2012", "2013" }));
        selectionYear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                selectionYearActionPerformed(evt);
            }
        });

        jLabel103.setText("Year:");

        org.jdesktop.layout.GroupLayout SetupSelectionPaneLayout = new org.jdesktop.layout.GroupLayout(SetupSelectionPane);
        SetupSelectionPane.setLayout(SetupSelectionPaneLayout);
        SetupSelectionPaneLayout.setHorizontalGroup(
            SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(SetupSelectionPaneLayout.createSequentialGroup()
                .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(SetupSelectionPaneLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(jLabel67)
                        .add(18, 18, 18)
                        .add(selectionRoomType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 126, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(68, 68, 68)
                        .add(jLabel103, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(selectionYear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 126, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(SetupSelectionPaneLayout.createSequentialGroup()
                        .add(30, 30, 30)
                        .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel72, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 341, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(SetupSelectionPaneLayout.createSequentialGroup()
                                .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jScrollPane11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 135, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(unavailableBuilding, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jLabel68))
                                .add(40, 40, 40)
                                .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel69)
                                    .add(availableBuilding, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 113, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jScrollPane12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 156, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(SetupSelectionPaneLayout.createSequentialGroup()
                                        .add(52, 52, 52)
                                        .add(housingSelectionSetupTabCompleteButton))
                                    .add(SetupSelectionPaneLayout.createSequentialGroup()
                                        .add(18, 18, 18)
                                        .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(org.jdesktop.layout.GroupLayout.TRAILING, SetupSelectionPaneLayout.createSequentialGroup()
                                                .add(jLabel71)
                                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                                .add(fieldStartTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                            .add(org.jdesktop.layout.GroupLayout.TRAILING, SetupSelectionPaneLayout.createSequentialGroup()
                                                .add(jLabel102)
                                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                                .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                                    .add(jLabel73, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 108, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                    .add(fieldEndTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
                                    .add(SetupSelectionPaneLayout.createSequentialGroup()
                                        .add(53, 53, 53)
                                        .add(jLabel70)
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                        .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(jLabel98, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 108, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(fieldDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))))))
                .add(20, 20, 20))
        );
        SetupSelectionPaneLayout.setVerticalGroup(
            SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(SetupSelectionPaneLayout.createSequentialGroup()
                .add(20, 20, 20)
                .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel67)
                    .add(selectionRoomType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(selectionYear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel103))
                .add(18, 18, 18)
                .add(jLabel72, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(SetupSelectionPaneLayout.createSequentialGroup()
                        .add(jLabel68)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(unavailableBuilding, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(SetupSelectionPaneLayout.createSequentialGroup()
                        .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel69)
                            .add(fieldDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel70))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel98)
                            .add(availableBuilding, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .add(18, 18, 18)
                .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane11)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane12)
                    .add(SetupSelectionPaneLayout.createSequentialGroup()
                        .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel71)
                            .add(fieldStartTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(SetupSelectionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(fieldEndTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel102))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(jLabel73)
                        .add(18, 18, 18)
                        .add(housingSelectionSetupTabCompleteButton)))
                .addContainerGap())
        );

        NotificationsPane.addTab("Setup Selection", SetupSelectionPane);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(NotificationsPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 607, Short.MAX_VALUE)
                .add(66, 66, 66))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .add(NotificationsPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void removeStudentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeStudentButtonActionPerformed
        if(JOptionPane.showConfirmDialog(null, "Are you sure you want to delete this student?")
                == JOptionPane.YES_OPTION){
        
            Student toDelete = (Student) studentList.getSelectedValue();
            int toDeleteID = toDelete.studentID;
            String removeStudentQuery = "Delete from DORMS.student where studentID='" + toDeleteID + "'";

             try
                    {
                        stmt.execute(removeStudentQuery);

                    }
                    catch(SQLException e)
                    {
                    }

            populateStudentList();
        }
    }//GEN-LAST:event_removeStudentButtonActionPerformed

    private void addStudentLastNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentLastNameActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_addStudentLastNameActionPerformed

    private void addStudentFirstNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentFirstNameActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_addStudentFirstNameActionPerformed

    private void addStudentGenderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentGenderActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_addStudentGenderActionPerformed

    private void addStudentCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentCancelActionPerformed

    clearAddStudentDialog();
addStudentDialog.setVisible(false);    }//GEN-LAST:event_addStudentCancelActionPerformed

    private void addStudentSubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentSubmitActionPerformed
    try{
        int studentID = Integer.parseInt(addStudentID.getText());
        String loginName = addStudentLoginName.getText();
        String password = String.copyValueOf(addStudentPassword.getPassword());
        String firstName = addStudentFirstName.getText();
        String lastName = addStudentLastName.getText();
        int gender = addStudentGender.getSelectedIndex();
        int gradClass = Integer.parseInt(addStudentGradClass.getText());
        Student student = new Student(studentID,loginName,password,firstName,
                lastName,gender,gradClass);
        if(student.addToDB(conn)){
            populateStudentList();
            addStudentDialog.setVisible(false);
            clearAddStudentDialog();
        }
            
    }catch(Exception e){
        JOptionPane.showMessageDialog(addStudentDialog, "Failed to add to the database. Please check for invalid input.");

    }
    }//GEN-LAST:event_addStudentSubmitActionPerformed

    private void addStudentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentButtonActionPerformed
        addStudentDialog.pack();
addStudentDialog.setVisible(true);    }//GEN-LAST:event_addStudentButtonActionPerformed

    private void editStudentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editStudentButtonActionPerformed
        Student studentEditting = (Student)studentList.getSelectedValue();
        setViewStudentDialog(studentEditting);
        

    }//GEN-LAST:event_editStudentButtonActionPerformed

private void addStudentIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentIDActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_addStudentIDActionPerformed

private void addStudentLoginNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentLoginNameActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_addStudentLoginNameActionPerformed

private void addStudentGradClassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentGradClassActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_addStudentGradClassActionPerformed

private void editStudentLastNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editStudentLastNameActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editStudentLastNameActionPerformed

private void editStudentGenderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editStudentGenderActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editStudentGenderActionPerformed

private void editStudentFirstNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editStudentFirstNameActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editStudentFirstNameActionPerformed

private void editStudentCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editStudentCancelActionPerformed
    editStudentDialog.setVisible(false); 
    clearEditStudentDialog();

}//GEN-LAST:event_editStudentCancelActionPerformed

private void viewSurveyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewSurveyActionPerformed
    int studentID = Integer.valueOf(editStudentID.getText());
    Student thisStudent = new Student(studentID,conn);
    Survey survey = thisStudent.getSurvey();
    surveyStudentID.setText(String.valueOf(survey.studentID));
    surveyStudentName.setText(thisStudent.firstName+" "+thisStudent.lastName);
    surveyYear.setText(String.valueOf(survey.year));
    DateFormat submittedFormat = new SimpleDateFormat("MM/dd/yy HH:mm");
    surveyDateSubmitted.setText(submittedFormat.format(survey.dateSubmitted.getTime()));
    String bedtime = survey.bedtime.get(Calendar.HOUR_OF_DAY)+":00";
    surveyBedtime.setText(bedtime);
    surveyNeatness.setText(String.valueOf(survey.neatness));
    surveyComments.setText(survey.comment);
    viewSurveyDialog.pack();
    viewSurveyDialog.setVisible(true);
    
}//GEN-LAST:event_viewSurveyActionPerformed

private void editStudentGradClassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editStudentGradClassActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editStudentGradClassActionPerformed

private void editStudentStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editStudentStatusActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editStudentStatusActionPerformed

    private void addBuildingCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBuildingCancelButtonActionPerformed
    clearAddBuildingDialog();

addBuildingDialog.setVisible(false);    }//GEN-LAST:event_addBuildingCancelButtonActionPerformed

    private void addBuildingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBuildingButtonActionPerformed
    
        addBuildingDialog.pack();
        addBuildingDialog.setVisible(true);
    }//GEN-LAST:event_addBuildingButtonActionPerformed

private void viewBuildingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewBuildingButtonActionPerformed
        Building buildingEditting = (Building)buildingList.getSelectedValue();
        setViewBuildlingDialog(buildingEditting);
        
}//GEN-LAST:event_viewBuildingButtonActionPerformed

private void deleteBuildingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteBuildingButtonActionPerformed
        if(JOptionPane.showConfirmDialog(null, "Are you sure you want to delete this building and all rooms in it?")
                == JOptionPane.YES_OPTION){
            Building buildingDeleting = (Building)buildingList.getSelectedValue();
            buildingDeleting.delete();

            buildingList.setListData(school.getBuildings().toArray());
        }

}//GEN-LAST:event_deleteBuildingButtonActionPerformed

private void addBuildingSubmitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBuildingSubmitButtonActionPerformed
    try{
        String buildingName = addBuildingName.getText();
        int buildingType = addBuildingType.getSelectedIndex();
        int buildingManagerID = Integer.parseInt(addBuildingManagerID.getText());
        String buildingDescription = addBuildingDescriptionField.getText();
        
        
        Building building = new Building(buildingName,buildingType,buildingManagerID,buildingDescription);
        if(building.addToDB(conn)){

            buildingList.setListData(school.getBuildings().toArray());

            addBuildingDialog.setVisible(false);
            clearAddBuildingDialog();
        }
    }catch(Exception e){
        JOptionPane.showMessageDialog(addBuildingDialog, "Failed to add to the database. Please check for invalid input.");

    }


}//GEN-LAST:event_addBuildingSubmitButtonActionPerformed

private void editBuildingCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editBuildingCancelButtonActionPerformed
    editBuildingDialog.setVisible(false); 
    clearEditBuildingDialog();

}//GEN-LAST:event_editBuildingCancelButtonActionPerformed

private void editBuildingSubmitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editBuildingSubmitButtonActionPerformed

    
    try{
        int buildingID = Integer.parseInt(editBuildingID.getText());
        Building building = new Building(buildingID,conn);
        building.buildingName = editBuildingName.getText();
        building.type = editBuildingType.getSelectedIndex();
        building.managerID = Integer.parseInt(editBuildingManagerID.getText());
        building.description = editBuildingDescriptionField.getText();
        if(building.update()){
            buildingList.setListData(school.getBuildings().toArray());
            editBuildingDialog.setVisible(false); 
            clearEditBuildingDialog();
        }
    }catch(Exception e){
        JOptionPane.showMessageDialog(editBuildingDialog, "Failed to update to the database. Please check input.");

    }
    
    

}//GEN-LAST:event_editBuildingSubmitButtonActionPerformed

    private void editBuildingViewRoomButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editBuildingViewRoomButtonActionPerformed
        Room roomEditting = (Room)editBuildingRoomList.getSelectedValue();
        setViewRoomDialog(roomEditting);
    }//GEN-LAST:event_editBuildingViewRoomButtonActionPerformed

    private void addRoomNumberActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addRoomNumberActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_addRoomNumberActionPerformed

    private void addRoomCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addRoomCancelButtonActionPerformed
    addRoomDialog.setVisible(false);
    clearAddRoomDialog();
    }//GEN-LAST:event_addRoomCancelButtonActionPerformed

private void editBuildingAddRoomButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editBuildingAddRoomButtonActionPerformed
    
    addRoomDialog.pack();
    addRoomDialog.setVisible(true);
    
}//GEN-LAST:event_editBuildingAddRoomButtonActionPerformed

private void editRoomNumberActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editRoomNumberActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editRoomNumberActionPerformed

private void editRoomCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editRoomCancelButtonActionPerformed
    editRoomDialog.setVisible(false);
    clearEditRoomDialog();
    
}//GEN-LAST:event_editRoomCancelButtonActionPerformed

private void editRoomSubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editRoomSubmitActionPerformed
    try{
        int roomID = Integer.parseInt(editRoomID.getText());
        Room room = new Room(roomID,conn);
        Building buildingEditting = new Building(Integer.valueOf(room.buildingID),conn);

        room.buildingID = Integer.parseInt(editRoomBuildingID.getText());
        room.floor = Integer.parseInt(editRoomFloor.getText());
        room.roomNumber = Integer.parseInt(editRoomNumber.getText());
        room.gender = editRoomGender.getSelectedIndex();
        room.type = editRoomType.getSelectedIndex();
        int available = editRoomAvail.getSelectedIndex(); 
        if (available == 1)
            room.isAvail = true;
        else
            room.isAvail = false;
                    
        int forFreshman = editRoomFreshman.getSelectedIndex(); 
        if (forFreshman == 1)
            room.forFreshman = true;
        else
            room.forFreshman = false;
        room.description = editRoomDescription.getText();
        if(room.update()){
            editBuildingRoomList.setListData(buildingEditting.getRooms().toArray());
            populateAssignmentDialog();
            editRoomDialog.setVisible(false); 
            clearEditRoomDialog();
        }

    }catch(Exception e){
        JOptionPane.showMessageDialog(editRoomDialog, "Failed to update to the database. Please check for invalid input.");

    }
    
}//GEN-LAST:event_editRoomSubmitActionPerformed

private void addRoomSubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addRoomSubmitActionPerformed
    try{
        Building buildingEditting = new Building(Integer.valueOf(editBuildingID.getText()),conn);
     
        int buildingID = Integer.parseInt(editBuildingID.getText());
        int floor = Integer.parseInt(addRoomFloor.getText());
        int roomNumber = Integer.parseInt(addRoomNumber.getText());
        int gender = addRoomGender.getSelectedIndex();
        int type = addRoomType.getSelectedIndex();
        
        boolean isAvail;
        int available = addRoomAvail.getSelectedIndex();
        if (available == 0)
            isAvail = true;
        else
            isAvail = false;
        
        
        boolean forFreshman;
        int freshman = addRoomForFreshman.getSelectedIndex();
        if (freshman == 0)
            forFreshman = true;
        else
            forFreshman = false;
        
        
        String description = addRoomDescription.getText();
        
        
        Room room = new Room(buildingID,floor,roomNumber,gender,type,isAvail,forFreshman,description);
        if(room.addToDB(conn)){
        
            editBuildingRoomList.setListData(buildingEditting.getRooms().toArray());

            addRoomDialog.setVisible(false);
            clearAddRoomDialog();
        }

    }catch(Exception e){
        JOptionPane.showMessageDialog(addRoomDialog, "Failed to add to the database. Please check for invalid input.");

    }


    
    
}//GEN-LAST:event_addRoomSubmitActionPerformed

private void addRoomFloorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addRoomFloorActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_addRoomFloorActionPerformed

private void editRoomFloorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editRoomFloorActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editRoomFloorActionPerformed

private void editRoomBuildingIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editRoomBuildingIDActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editRoomBuildingIDActionPerformed

private void editRoomGenderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editRoomGenderActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editRoomGenderActionPerformed

private void editBuildingRemoveRoomButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editBuildingRemoveRoomButtonActionPerformed
    if(JOptionPane.showConfirmDialog(null, "Are you sure you want to delete this room?")
                == JOptionPane.YES_OPTION){
        Building buildingEditting = new Building(Integer.valueOf(editBuildingID.getText()),conn);
    
        Room toDelete = (Room) editBuildingRoomList.getSelectedValue();
        int toDeleteID = toDelete.roomID;
        String removeRoomQuery = "DELETE FROM DORMS.room where roomID='" + toDeleteID + "'";
        
         try
                {
                    stmt.execute(removeRoomQuery);

                }
                catch(SQLException e)
                {
                }
         
        editBuildingRoomList.setListData(buildingEditting.getRooms().toArray());

    }
}//GEN-LAST:event_editBuildingRemoveRoomButtonActionPerformed

private void viewRequestActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewRequestActionPerformed
        Request requestViewing = (Request)notificationList.getSelectedValue();
        setViewRequestDialog(requestViewing);
        
    
}//GEN-LAST:event_viewRequestActionPerformed

private void viewRequestApproveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewRequestApproveActionPerformed
    Request requestViewing = new Request(Integer.valueOf(viewRequestID.getText()),conn);
        
    if(requestViewing.mark(requestViewing.STATUS_APPROVED)){   
        notificationList.setListData(school.setUpNotifications());
        viewRequestDialog.setVisible(false);
        clearViewRequestDialog();
    }

    
}//GEN-LAST:event_viewRequestApproveActionPerformed

private void viewRequestDisapproveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewRequestDisapproveActionPerformed
    Request requestViewing = new Request(Integer.valueOf(viewRequestID.getText()),conn);
        
    if(requestViewing.mark(requestViewing.STATUS_DISAPPROVED)){
        notificationList.setListData(school.setUpNotifications());
        viewRequestDialog.setVisible(false);
        clearViewRequestDialog();
    }


}//GEN-LAST:event_viewRequestDisapproveActionPerformed

private void requestMarkNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_requestMarkNewActionPerformed
        Request requestViewing = (Request)notificationList.getSelectedValue();
        
        requestViewing.mark(requestViewing.STATUS_NEW);
        
        notificationList.setListData(school.setUpNotifications());
        
    
}//GEN-LAST:event_requestMarkNewActionPerformed

private void viewRequestCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewRequestCancelActionPerformed
    viewRequestDialog.setVisible(false);
    clearViewRequestDialog();
}//GEN-LAST:event_viewRequestCancelActionPerformed

    private void makeAssingmentsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_makeAssingmentsButtonActionPerformed
        clearAssignmentDialog();
        Building dummy = new Building("All Buildings", 1, 0, "");
        ArrayList<Building> display = new ArrayList<Building>();
        display.add(dummy);
        display.addAll(school.getBuildings());
        assignmentBuilding.setModel(new DefaultComboBoxModel(display.toArray()));

        if(buildingList.getSelectedValue() != null){
            assignmentBuilding.setSelectedIndex(buildingList.getSelectedIndex()+1);
        }
        forTerm1.setSelected(true);
        forTerm2.setSelected(true);
        forTerm3.setSelected(true);
        
        populateAssignmentDialog();

        
        makeAssignmentsDialog.pack();
        makeAssignmentsDialog.setVisible(true);
    }//GEN-LAST:event_makeAssingmentsButtonActionPerformed

    private void assignmentsCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assignmentsCancelButtonActionPerformed
        makeAssignmentsDialog.setVisible(false);
        clearAssignmentDialog();
    }//GEN-LAST:event_assignmentsCancelButtonActionPerformed

    private void matchRoommatesMakeSuggestionsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matchRoommatesMakeSuggestionsButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_matchRoommatesMakeSuggestionsButtonActionPerformed

    private void matchRoommatesCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matchRoommatesCancelButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_matchRoommatesCancelButtonActionPerformed

    private void matchRoommatesFilterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matchRoommatesFilterButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_matchRoommatesFilterButtonActionPerformed

private void editRoomDescriptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editRoomDescriptionActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_editRoomDescriptionActionPerformed

private void assignmentsDialogMakeAssignmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assignmentsDialogMakeAssignmentActionPerformed
    Room room = (Room) unAssignedRooms.getSelectedValue();
    Student student = (Student) unAssignedStudents.getSelectedValue();
    Assignment assign = new Assignment(room.roomID, student.studentID, Integer.parseInt(assignmentYearCombo.getSelectedItem().toString()),
            forTerm1.isSelected(),forTerm2.isSelected(),forTerm3.isSelected());
    if(assign.addToDB(conn)){
        populateAssignmentDialog();
    }
}//GEN-LAST:event_assignmentsDialogMakeAssignmentActionPerformed

private void assignmentYearComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assignmentYearComboActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_assignmentYearComboActionPerformed

private void forTerm1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_forTerm1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_forTerm1ActionPerformed

private void forTerm3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_forTerm3ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_forTerm3ActionPerformed

private void forTerm2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_forTerm2ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_forTerm2ActionPerformed

private void assignmentFilterYearTermActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assignmentFilterYearTermActionPerformed
    populateAssignmentDialog();
}//GEN-LAST:event_assignmentFilterYearTermActionPerformed

    private void surveyCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_surveyCloseActionPerformed
    clearSurveyDialog();
    viewSurveyDialog.setVisible(false);
    }//GEN-LAST:event_surveyCloseActionPerformed

private void newStaffUsernameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newStaffUsernameActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_newStaffUsernameActionPerformed

private void createStudentStaffActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createStudentStaffActionPerformed
      try{
        studentStaff myStudentStaff = new studentStaff(newStudentStaffUsername.getText(),
                String.valueOf(newStudentStaffPassword.getPassword()),Integer.valueOf(newStudentStaffBuilding.getText()));
        if(myStudentStaff.addToDB(conn))
            clearCreateStudentStaff();
      }catch(Exception e){
            JOptionPane.showMessageDialog(this, "Unable to add staff. Please check for invalid input");

      }
    
}//GEN-LAST:event_createStudentStaffActionPerformed

private void createStaffActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createStaffActionPerformed
     try{
        Staff myStaff = new Staff(newStaffUsername.getText(),
                String.valueOf(newStaffPassword.getPassword()));
        if(myStaff.addToDB(conn))
            clearCreateStaff();
     }catch(Exception e){
        JOptionPane.showMessageDialog(this, "Unable to add staff. Please check for invalid input");

     }
}//GEN-LAST:event_createStaffActionPerformed

private void selectionRoomTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectionRoomTypeActionPerformed
    populateHousingSetup(selectionRoomType.getSelectedIndex());
    
}//GEN-LAST:event_selectionRoomTypeActionPerformed

private void unavailableBuildingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unavailableBuildingActionPerformed
    int type = selectionRoomType.getSelectedIndex();
    if(unavailableBuilding.getSelectedIndex() == 0){ //All Buildings
        unavailableList.setListData(school.getUnavailableRooms(type).toArray());
    }else{
        Building building = (Building) unavailableBuilding.getSelectedItem();
        ArrayList<Room> filtered = school.filterByBuilding(school.getUnavailableRooms(type),
                building.buildingID);
        unavailableList.setListData(filtered.toArray());
    }
     
}//GEN-LAST:event_unavailableBuildingActionPerformed

private void availableBuildingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_availableBuildingActionPerformed
    
    int type = selectionRoomType.getSelectedIndex();
    if(availableBuilding.getSelectedIndex() == 0){ //All Buildings
        availableList.setListData(school.getAvailableRooms(type).toArray());
    }else{
        Building building = (Building) availableBuilding.getSelectedItem();
        ArrayList<Room> filtered = school.filterByBuilding(school.getAvailableRooms(type),
                building.buildingID);
        availableList.setListData(filtered.toArray());
    }
    
    
}//GEN-LAST:event_availableBuildingActionPerformed

private void SetupSelectionPaneMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SetupSelectionPaneMouseClicked
    populateHousingSetup(selectionRoomType.getSelectedIndex());
    
}//GEN-LAST:event_SetupSelectionPaneMouseClicked

private void unavailableListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_unavailableListMouseClicked
    if (evt.getClickCount() == 2) {
        Room unavailable = (Room) unavailableList.getSelectedValue();
        if(unavailable != null)
            setViewRoomDialog(unavailable);
        
    }
}//GEN-LAST:event_unavailableListMouseClicked

private void availableListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_availableListMouseClicked
    if (evt.getClickCount() == 2) {
        Room available = (Room) availableList.getSelectedValue();
        if(available != null)
            setViewRoomDialog(available);
        
    }
}//GEN-LAST:event_availableListMouseClicked

private void fieldDateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fieldDateActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_fieldDateActionPerformed

private void housingSelectionSetupTabCompleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_housingSelectionSetupTabCompleteButtonActionPerformed
  try{
    Calendar startDateTime = Calendar.getInstance();
    Calendar endDateTime = Calendar.getInstance();

    SimpleDateFormat dateFormatter = new SimpleDateFormat("MM/dd/yy");
    SimpleDateFormat timeFormatter = new SimpleDateFormat("hh:mm a");
    
    Calendar dateInput = Calendar.getInstance();
    Calendar startInput = Calendar.getInstance();
    Calendar endInput = Calendar.getInstance();

    dateInput.setTime((Date)fieldDate.getValue());
    startInput.setTime((Date)fieldStartTime.getValue());
    endInput.setTime((Date)fieldEndTime.getValue());
    startDateTime.set(dateInput.get(Calendar.YEAR),dateInput.get(Calendar.MONTH),dateInput.get(Calendar.DAY_OF_MONTH),
            startInput.get(Calendar.HOUR_OF_DAY),startInput.get(Calendar.MINUTE),startInput.get(Calendar.SECOND));
    endDateTime.set(dateInput.get(Calendar.YEAR),dateInput.get(Calendar.MONTH),dateInput.get(Calendar.DAY_OF_MONTH),
            endInput.get(Calendar.HOUR_OF_DAY),endInput.get(Calendar.MINUTE),endInput.get(Calendar.SECOND));
    
    
    
    if(school.setHousingSelection(Integer.parseInt(selectionYear.getSelectedItem().toString()),
        selectionRoomType.getSelectedIndex(), startDateTime, endDateTime)){
      JOptionPane.showMessageDialog(this, "Setup successful.");
        
    }
    
  }catch(Exception e){
      JOptionPane.showMessageDialog(this, "Setup failed, please check for invalid input.");

  }
    
}//GEN-LAST:event_housingSelectionSetupTabCompleteButtonActionPerformed

private void fieldStartTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fieldStartTimeActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_fieldStartTimeActionPerformed

private void fieldEndTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fieldEndTimeActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_fieldEndTimeActionPerformed

private void selectionYearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectionYearActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_selectionYearActionPerformed

private void editStudentSubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editStudentSubmitActionPerformed
    try{
        int studentID = Integer.parseInt(editStudentID.getText());

        Student student = new Student(studentID,conn);
        student.studentID = Integer.parseInt(editStudentID.getText());
        student.firstName = editStudentFirstName.getText();
        student.lastName = editStudentLastName.getText();
        student.gender = editStudentGender.getSelectedIndex();
        student.gradClass = Integer.parseInt(editStudentGradClass.getText());
        student.status = editStudentStatus.getSelectedIndex();
        if(student.update()){

            populateStudentList();
            editStudentDialog.setVisible(false); 
            clearEditStudentDialog();
        }
    }catch(Exception e){
        JOptionPane.showMessageDialog(editStudentDialog, "Update failed. Please check for invalid input.");

    }

}//GEN-LAST:event_editStudentSubmitActionPerformed

private void matchStudentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matchStudentButtonActionPerformed
// TODO add your handling code here:
    int studentID = Integer.parseInt(editStudentID.getText());
    
    Matchmaker m = new Matchmaker();
    
    matchRoommateStudentList.setListData(m.surveys.toArray());
    
    matchRoommatesDialog.setVisible(false); 
    //clearEditStudentDialog();
}//GEN-LAST:event_matchStudentButtonActionPerformed

private void studentRegistrationsComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_studentRegistrationsComboActionPerformed
    if(studentRegistrationsCombo.getSelectedIndex() != 0){
        setRegistrationDialog(Integer.valueOf(editStudentID.getText()),
                Integer.valueOf((String)studentRegistrationsCombo.getSelectedItem()));
        viewRegistrationDialog.pack();
        viewRegistrationDialog.setVisible(true);
    }
}//GEN-LAST:event_studentRegistrationsComboActionPerformed

private void registrationCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registrationCloseActionPerformed
    viewRegistrationDialog.setVisible(false);
    clearRegistrationDialog();
    
}//GEN-LAST:event_registrationCloseActionPerformed

private void studentListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_studentListMouseClicked
    if(evt.getClickCount() == 2){
        Student studentEditting = (Student)studentList.getSelectedValue();
        setViewStudentDialog(studentEditting);
    }

}//GEN-LAST:event_studentListMouseClicked

private void buildingListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buildingListMouseClicked
    if(evt.getClickCount() == 2){
        Building buildingEditting = (Building)buildingList.getSelectedValue();
        setViewBuildlingDialog(buildingEditting);

    }
}//GEN-LAST:event_buildingListMouseClicked

private void notificationListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_notificationListMouseClicked
    if(evt.getClickCount() == 2){
        Request requestViewing = (Request)notificationList.getSelectedValue();
        setViewRequestDialog(requestViewing);
    }
        
}//GEN-LAST:event_notificationListMouseClicked

private void editBuildingRoomListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_editBuildingRoomListMouseClicked
    if(evt.getClickCount() == 2){
        Room roomEditting = (Room)editBuildingRoomList.getSelectedValue();
        setViewRoomDialog(roomEditting);
    }
}//GEN-LAST:event_editBuildingRoomListMouseClicked

private void unAssignedStudentsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_unAssignedStudentsMouseClicked
    if(evt.getClickCount() == 2){
        Student studentEditting = (Student)unAssignedStudents.getSelectedValue();
        setViewStudentDialog(studentEditting);
    }
}//GEN-LAST:event_unAssignedStudentsMouseClicked

private void unAssignedRoomsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_unAssignedRoomsMouseClicked
    if(evt.getClickCount() == 2){
        Room roomEditting = (Room)unAssignedRooms.getSelectedValue();
        setViewRoomDialog(roomEditting);
    }}//GEN-LAST:event_unAssignedRoomsMouseClicked

private void staffLoginUsernameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_staffLoginUsernameActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_staffLoginUsernameActionPerformed

private void staffLoginCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_staffLoginCancelButtonActionPerformed
    System.exit(1);
}//GEN-LAST:event_staffLoginCancelButtonActionPerformed

private void StaffLoginLoginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_StaffLoginLoginButtonActionPerformed
    String username = staffLoginUsername.getText();
    String password = String.valueOf(staffLoginPassword.getPassword());
    if(login(username,password)){
        populateStudentList();
        populateHousingSetup(selectionRoomType.getSelectedIndex());
        buildingList.setListData(school.getBuildings().toArray());
        notificationList.setListData(school.setUpNotifications());
        notificationPane.setVisible(true);
        clearLoginDialog();
        staffLoginDialog.setVisible(false);
    }else{
        JOptionPane.showMessageDialog(staffLoginDialog, "Login failed.");

    }
    
        
}//GEN-LAST:event_StaffLoginLoginButtonActionPerformed

private void staffLoginDialogWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_staffLoginDialogWindowClosed
}//GEN-LAST:event_staffLoginDialogWindowClosed

    private void viewStudentViewAssignmentsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewStudentViewAssignmentsButtonActionPerformed

populateAssignmentTable();
        
    }//GEN-LAST:event_viewStudentViewAssignmentsButtonActionPerformed

    private void disassociateStudentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_disassociateStudentButtonActionPerformed
       JOptionPane.showConfirmDialog(this, "Are you sure you want to disassociate this student from this room?");
        try {
       //     int select = assignmentTable.getSelectedRow();

       //  ResultSet rset = stmt.executeQuery("Select * from DORMS.assignment where studentID = '" + editStudentID + "'");
       //  rset.next();
      //   if (rset.getRow() != select+1) {
      //   rset.next();
      //    }
           String dis = "DELETE FROM DORMS.assignment WHERE studentID = ?";
            PreparedStatement deleteRoomStmt = conn.prepareStatement(dis);
         //   deleteRoomStmt.setInt(1, rset.getInt(3));
            deleteRoomStmt.setInt(1, Integer.parseInt(editStudentID.getText()));
            deleteRoomStmt.executeUpdate();
        } catch (SQLException ex) {
            Logger.getLogger(DORMS.class.getName()).log(Level.SEVERE, null, ex);
        }
populateAssignmentTable();
    }//GEN-LAST:event_disassociateStudentButtonActionPerformed

private void assignmentRoomIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assignmentRoomIDActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_assignmentRoomIDActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(DORMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(DORMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(DORMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(DORMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new DORMS().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel AdminPane;
    private javax.swing.JTabbedPane NotificationsPane;
    private javax.swing.JPanel SetupSelectionPane;
    private javax.swing.JButton StaffLoginLoginButton;
    private javax.swing.JButton addBuildingButton;
    private javax.swing.JButton addBuildingCancelButton;
    private javax.swing.JScrollPane addBuildingDescription;
    private javax.swing.JTextArea addBuildingDescriptionField;
    private javax.swing.JDialog addBuildingDialog;
    private javax.swing.JTextField addBuildingManagerID;
    private javax.swing.JTextField addBuildingName;
    private javax.swing.JButton addBuildingSubmitButton;
    private javax.swing.JComboBox addBuildingType;
    private javax.swing.JComboBox addRoomAvail;
    private javax.swing.JButton addRoomCancelButton;
    private javax.swing.JTextField addRoomDescription;
    private javax.swing.JDialog addRoomDialog;
    private javax.swing.JTextField addRoomFloor;
    private javax.swing.JComboBox addRoomForFreshman;
    private javax.swing.JComboBox addRoomGender;
    private javax.swing.JTextField addRoomNumber;
    private javax.swing.JButton addRoomSubmit;
    private javax.swing.JComboBox addRoomType;
    private javax.swing.JButton addStudentButton;
    private javax.swing.JButton addStudentCancel;
    private javax.swing.JDialog addStudentDialog;
    private javax.swing.JTextField addStudentFirstName;
    private javax.swing.JComboBox addStudentGender;
    private javax.swing.JTextField addStudentGradClass;
    private javax.swing.JTextField addStudentID;
    private javax.swing.JTextField addStudentLastName;
    private javax.swing.JTextField addStudentLoginName;
    private javax.swing.JPasswordField addStudentPassword;
    private javax.swing.JButton addStudentSubmit;
    private javax.swing.JDialog assignedRoomsToStudent;
    private javax.swing.JComboBox assignmentBuilding;
    private javax.swing.JButton assignmentFilterYearTerm;
    private javax.swing.JTextField assignmentRoomID;
    private javax.swing.JTextField assignmentStudentID;
    private javax.swing.JComboBox assignmentStudentType;
    private javax.swing.JTable assignmentTable;
    private javax.swing.JComboBox assignmentYearCombo;
    private javax.swing.JButton assignmentsCancelButton;
    private javax.swing.JButton assignmentsDialogMakeAssignment;
    private javax.swing.JComboBox availableBuilding;
    private javax.swing.JList availableList;
    private javax.swing.JList buildingList;
    private javax.swing.JPanel buildingPane;
    private javax.swing.JButton createStaff;
    private javax.swing.JButton createStudentStaff;
    private javax.swing.JButton deleteBuildingButton;
    private javax.swing.JButton disassociateStudentButton;
    private javax.swing.JButton editBuildingAddRoomButton;
    private javax.swing.JButton editBuildingCancelButton;
    private javax.swing.JScrollPane editBuildingDescription;
    private javax.swing.JTextArea editBuildingDescriptionField;
    private javax.swing.JDialog editBuildingDialog;
    private javax.swing.JLabel editBuildingID;
    private javax.swing.JTextField editBuildingManagerID;
    private javax.swing.JTextField editBuildingName;
    private javax.swing.JButton editBuildingRemoveRoomButton;
    private javax.swing.JList editBuildingRoomList;
    private javax.swing.JButton editBuildingSubmitButton;
    private javax.swing.JComboBox editBuildingType;
    private javax.swing.JButton editBuildingViewRoomButton;
    private javax.swing.JComboBox editRoomAvail;
    private javax.swing.JTextField editRoomBuildingID;
    private javax.swing.JButton editRoomCancelButton;
    private javax.swing.JTextField editRoomDescription;
    private javax.swing.JDialog editRoomDialog;
    private javax.swing.JTextField editRoomFloor;
    private javax.swing.JComboBox editRoomFreshman;
    private javax.swing.JComboBox editRoomGender;
    private javax.swing.JLabel editRoomID;
    private javax.swing.JTextField editRoomNumber;
    private javax.swing.JButton editRoomSubmit;
    private javax.swing.JComboBox editRoomType;
    private javax.swing.JButton editStudentButton;
    private javax.swing.JButton editStudentCancel;
    private javax.swing.JDialog editStudentDialog;
    private javax.swing.JTextField editStudentFirstName;
    private javax.swing.JComboBox editStudentGender;
    private javax.swing.JTextField editStudentGradClass;
    private javax.swing.JLabel editStudentID;
    private javax.swing.JTextField editStudentLastName;
    private javax.swing.JLabel editStudentLotteryNumber;
    private javax.swing.JComboBox editStudentStatus;
    private javax.swing.JButton editStudentSubmit;
    private javax.swing.JFormattedTextField fieldDate;
    private javax.swing.JFormattedTextField fieldEndTime;
    private javax.swing.JFormattedTextField fieldStartTime;
    private javax.swing.JCheckBox forTerm1;
    private javax.swing.JCheckBox forTerm2;
    private javax.swing.JCheckBox forTerm3;
    private javax.swing.JButton housingSelectionSetupTabCompleteButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel100;
    private javax.swing.JLabel jLabel101;
    private javax.swing.JLabel jLabel102;
    private javax.swing.JLabel jLabel103;
    private javax.swing.JLabel jLabel104;
    private javax.swing.JLabel jLabel105;
    private javax.swing.JLabel jLabel107;
    private javax.swing.JLabel jLabel108;
    private javax.swing.JLabel jLabel109;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel110;
    private javax.swing.JLabel jLabel111;
    private javax.swing.JLabel jLabel112;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel64;
    private javax.swing.JLabel jLabel65;
    private javax.swing.JLabel jLabel66;
    private javax.swing.JLabel jLabel67;
    private javax.swing.JLabel jLabel68;
    private javax.swing.JLabel jLabel69;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel70;
    private javax.swing.JLabel jLabel71;
    private javax.swing.JLabel jLabel72;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel76;
    private javax.swing.JLabel jLabel77;
    private javax.swing.JLabel jLabel78;
    private javax.swing.JLabel jLabel79;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel80;
    private javax.swing.JLabel jLabel88;
    private javax.swing.JLabel jLabel89;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabel90;
    private javax.swing.JLabel jLabel91;
    private javax.swing.JLabel jLabel92;
    private javax.swing.JLabel jLabel93;
    private javax.swing.JLabel jLabel94;
    private javax.swing.JLabel jLabel95;
    private javax.swing.JLabel jLabel96;
    private javax.swing.JLabel jLabel97;
    private javax.swing.JLabel jLabel98;
    private javax.swing.JLabel jLabel99;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JDialog makeAssignmentsDialog;
    private javax.swing.JButton makeAssingmentsButton;
    private javax.swing.JList matchRoommateStudentList;
    private javax.swing.JButton matchRoommatesCancelButton;
    private javax.swing.JDialog matchRoommatesDialog;
    private javax.swing.JButton matchRoommatesFilterButton;
    private javax.swing.JTextField matchRoommatesFilterField;
    private javax.swing.JButton matchRoommatesMakeAssignmentButton;
    private javax.swing.JButton matchRoommatesMakeSuggestionsButton;
    private javax.swing.JList matchRoommatesSuggestionsList;
    private javax.swing.JButton matchStudentButton;
    private javax.swing.JPasswordField newStaffPassword;
    private javax.swing.JTextField newStaffUsername;
    private javax.swing.JTextField newStudentStaffBuilding;
    private javax.swing.JPasswordField newStudentStaffPassword;
    private javax.swing.JTextField newStudentStaffUsername;
    private javax.swing.JList notificationList;
    private javax.swing.JPanel notificationPane;
    private javax.swing.JButton registrationClose;
    private javax.swing.JLabel registrationDateSubmitted;
    private javax.swing.JLabel registrationSignature;
    private javax.swing.JLabel registrationStudentID;
    private javax.swing.JLabel registrationStudentName;
    private javax.swing.JLabel registrationTerms;
    private javax.swing.JLabel registrationYear;
    private javax.swing.JButton removeStudentButton;
    private javax.swing.JButton requestMarkNew;
    private javax.swing.JComboBox selectionRoomType;
    private javax.swing.JComboBox selectionYear;
    private javax.swing.JButton staffLoginCancelButton;
    private javax.swing.JDialog staffLoginDialog;
    private javax.swing.JPasswordField staffLoginPassword;
    private javax.swing.JTextField staffLoginUsername;
    private javax.swing.JList studentList;
    private javax.swing.JPanel studentPane;
    private javax.swing.JComboBox studentRegistrationsCombo;
    private javax.swing.JLabel surveyBedtime;
    private javax.swing.JButton surveyClose;
    private javax.swing.JTextArea surveyComments;
    private javax.swing.JLabel surveyDateSubmitted;
    private javax.swing.JLabel surveyNeatness;
    private javax.swing.JLabel surveyStudentID;
    private javax.swing.JLabel surveyStudentName;
    private javax.swing.JLabel surveyYear;
    private javax.swing.JList unAssignedRooms;
    private javax.swing.JList unAssignedStudents;
    private javax.swing.JComboBox unavailableBuilding;
    private javax.swing.JList unavailableList;
    private javax.swing.JButton viewBuildingButton;
    private javax.swing.JDialog viewRegistrationDialog;
    private javax.swing.JButton viewRequest;
    private javax.swing.JButton viewRequestApprove;
    private javax.swing.JButton viewRequestCancel;
    private javax.swing.JDialog viewRequestDialog;
    private javax.swing.JButton viewRequestDisapprove;
    private javax.swing.JLabel viewRequestID;
    private javax.swing.JTextArea viewRequestIdealRoom;
    private javax.swing.JTextArea viewRequestReason;
    private javax.swing.JLabel viewRequestStatus;
    private javax.swing.JLabel viewRequestStudentID;
    private javax.swing.JLabel viewRequestType;
    private javax.swing.JLabel viewRequestYear;
    private javax.swing.JLabel viewRoomAssignmentsStudentNameLabel;
    private javax.swing.JButton viewStudentViewAssignmentsButton;
    private javax.swing.JButton viewSurvey;
    private javax.swing.JDialog viewSurveyDialog;
    // End of variables declaration//GEN-END:variables
private void populateStudentList() {
    System.out.println("out");
    studentListMap.clear();

    String query = "select * from DORMS.Student";
        try
        {
            ResultSet rset = stmt.executeQuery(query);

            while (rset.next())
            {
                int id = rset.getInt(1);
                String name = rset.getString(2);
                Boolean isMale = rset.getBoolean(3);
               
                Student student  = new Student(id, conn);
                        
             studentListMap.put(id, student);
                                System.out.println(studentListMap.size());

       
            }
        }
        catch(SQLException e)
        {
        }
        Set<Integer> studentSet = studentListMap.keySet();
        Iterator<Integer> iter = studentSet.iterator();
        ArrayList<Student> students = new ArrayList<Student>();
        while (iter.hasNext()) {

            Student thisStudent = (Student) studentListMap.get(iter.next());
        
                students.add(thisStudent);
            }
        System.out.println(studentSet.size());

        studentList.setListData(students.toArray());
        }

public void populateAssignmentDialog() {
    ArrayList<Student> unAssignedStudentList = new ArrayList<Student>();
    ArrayList<Room> unAssignedRoomList = new ArrayList<Room>();
    ArrayList<Room> toDisplay = new ArrayList<Room>();
    
    

    boolean newStudent = false;
    if(assignmentStudentType.getSelectedIndex() == 0)
        newStudent = true;
    else
        newStudent = false;
        
    int year = Integer.parseInt(assignmentYearCombo.getSelectedItem().toString());
    
    if(assignmentBuilding.getSelectedIndex() == 0){ //All Buildings
        ArrayList<Building> allBuildings = school.getBuildings();
        
        for(int i = 0; i < allBuildings.size(); i++){
            ArrayList<Room> thisBuilding = findEmptyRooms(allBuildings.get(i), year, newStudent, forTerm1.isSelected(), 
                    forTerm2.isSelected(), forTerm3.isSelected());
            toDisplay.addAll(thisBuilding);
        }
        
        unAssignedRooms.setListData(toDisplay.toArray());
        
    }else{
        Building building = (Building) assignmentBuilding.getSelectedItem();
        unAssignedRoomList = findEmptyRooms(building, year, newStudent, forTerm1.isSelected(), 
            forTerm2.isSelected(), forTerm3.isSelected());
        unAssignedRooms.setListData(unAssignedRoomList.toArray());

    
    }
    /*
    
    //Populate the room list with rooms that are not assigned for the selected year and terms
    unAssignedRoomList = findEmptyRooms(selectedBuilding, year, newStudent, forTerm1.isSelected(), 
            forTerm2.isSelected(), forTerm3.isSelected());
    unAssignedRooms.setListData(unAssignedRoomList.toArray());
    */
    
    
    //populates with students who are registered for the selected terms but do not have corresponding assignments
    unAssignedStudentList = findUnassignedStudents(year, newStudent, forTerm1.isSelected(), 
            forTerm2.isSelected(), forTerm3.isSelected());
    
    unAssignedStudents.setListData(unAssignedStudentList.toArray());
   
     
 
}




private ArrayList<Room> findEmptyRooms(Building building, int year, boolean newStudent,
        boolean forTerm1, boolean forTerm2, boolean forTerm3){
       ArrayList<Room> emptyRoomList = new ArrayList<Room>();
   
   int roomID = 0;
   
   
   emptyRoomList = building.getRooms();
   for (int i = 0;i < emptyRoomList.size();i++){
        String query = "SELECT * FROM DORMS.assignment a JOIN DORMS.room r WHERE a.roomID = r.roomID AND "
                + "a.roomID = " + emptyRoomList.get(i).roomID + " AND a.year = " + year;

        boolean removeRoom = false;
        Room toCheck = new Room(emptyRoomList.get(i).roomID,conn);
        if(newStudent){
            if(toCheck.forFreshman == false)
                removeRoom = true;
        } else {
             if(toCheck.forFreshman == true)
                removeRoom = true;
        }



        try{
            if (forTerm1){
                ResultSet result = stmt.executeQuery(query + " AND a.forTerm1 is TRUE");
                if(Assignment.checkFull(emptyRoomList.get(i).roomID,result,conn))
                    removeRoom = true;

            }

            if (removeRoom == false && forTerm2){                
                ResultSet result = stmt.executeQuery(query + " AND a.forTerm2 is TRUE");
                if(Assignment.checkFull(emptyRoomList.get(i).roomID,result,conn))
                    removeRoom = true;

            }

            if (removeRoom == false && forTerm3){                
                ResultSet result = stmt.executeQuery(query + " AND a.forTerm3 is TRUE");
                if(Assignment.checkFull(emptyRoomList.get(i).roomID,result,conn))
                    removeRoom = true;

            }


        }catch(SQLException e){
            JOptionPane.showMessageDialog(makeAssignmentsDialog,
                    "Unable to populate room list.");
        }

        if (removeRoom){
            emptyRoomList.remove(i);
            i--;
        } else if (!assignmentRoomID.getText().equals("")){
            roomID = Integer.valueOf(assignmentRoomID.getText());

            if (emptyRoomList.get(i).roomID == roomID)
                return new ArrayList<Room>(Arrays.asList(emptyRoomList.get(i)));
            else {
                emptyRoomList.remove(i);
                i--;
            }
        }
   }
       
   
   
   
   return emptyRoomList;

}


private ArrayList<Student> findUnassignedStudents(int year, boolean newStudent, boolean forTerm1, boolean forTerm2, boolean forTerm3){
   ArrayList<Student> list = new ArrayList<Student>();
   
   // Add all students registered for the checked terms into list
   String query = "SELECT s.studentID FROM DORMS.Registration r JOIN DORMS.student s WHERE s.studentID = r.studentID "
           + "AND year = ?";
   
   if(newStudent)
       query += " AND s.status = "+ Student.STATUS_NEW;
   else 
       query += " AND s.status != "+ Student.STATUS_NEW;
   
   if(forTerm1)
       query += " AND r.onCampusTerm1 is TRUE";
   if(forTerm2)
       query += " AND r.onCampusTerm2 is TRUE";
   if(forTerm3)
       query += " AND r.onCampusTerm3 is TRUE";
   
   PreparedStatement registeredStmt;

   try{
       registeredStmt = conn.prepareStatement(query);  
       registeredStmt.setInt(1, year);
   
       ResultSet result = registeredStmt.executeQuery();
       while(result.next()){
           
           list.add(new Student(result.getInt(1),conn));
       }
       
       
   }catch(SQLException e){
            JOptionPane.showMessageDialog(makeAssignmentsDialog,"Unable to populate student list. "+e.getMessage());
   }

   
   
   //Remove students already assigned to checked terms from list

   for(int i = 0; i < list.size(); i++){
        boolean removeStudent = false;

        String query2 = "SELECT * FROM DORMS.assignment WHERE studentID = "+ 
                list.get(i).studentID + " AND year = " + year;

        try{
            if (forTerm1){
                ResultSet result = stmt.executeQuery(query2 + " AND forTerm1 is TRUE");
                if(result.next()){
                    removeStudent = true;
                }
            }
            if (removeStudent == false && forTerm2){                
                ResultSet result = stmt.executeQuery(query2 + " AND forTerm2 is TRUE");
                if(result.next()){
                    removeStudent = true;
                }
            }

            if (removeStudent == false && forTerm3){                
                ResultSet result = stmt.executeQuery(query2 + " AND forTerm3 is TRUE");
                if(result.next()){
                    removeStudent = true;
                }
            }

        
        }catch(SQLException e){
            JOptionPane.showMessageDialog(makeAssignmentsDialog,
                    "Unable to populate student list.");
        }
        
        if (removeStudent){
            list.remove(i);
            i--;
        } else if (!assignmentStudentID.getText().equals("")){
            if (list.get(i).studentID == Integer.parseInt(assignmentStudentID.getText()))
                return new ArrayList<Student>(Arrays.asList(list.get(i)));
            else {
                list.remove(i);
                i--;
            }
        }

   
   }
   
   return list;
}




public void connect()
    {
        try 
        {
            // Load the JDBC driver
            Class.forName("com.mysql.jdbc.Driver");
            System.out.println("Driver loaded");

            // Establish a connection
            conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/DORMS?user=root&password=dorms");
            System.out.println("Database connected");

            // Create a Statement
            stmt = (Statement) conn.createStatement();
            stmt2 = (Statement) conn.createStatement();
            stmt3 = (Statement) conn.createStatement();

        } 
        catch (Exception ex) 
        {
            System.out.println(ex);
        }
    }

    private void populateAssignmentTable() {
      viewRoomAssignmentsStudentNameLabel.setText(editStudentFirstName.getText() + " " + editStudentLastName.getText());
               //     DefaultTableModel model = new DefaultTableModel();
String building = null;
int roomNumber = 0;
String year;
ArrayList<Object[]> assignments = new ArrayList<Object[]>();
        try {
            ResultSet rset = stmt.executeQuery("Select roomID, year, forTerm1, forTerm2, forTerm3 from DORMS.assignment where studentID = '" + editStudentID.getText() + "'");
            while (rset.next()){
            ResultSet rset2 = stmt2.executeQuery("Select buildingID, roomNumber from DORMS.room where roomID = '" + rset.getString("roomID") + "'");
            while (rset2.next()){
            ResultSet rset3 = stmt3.executeQuery("Select buildingName from DORMS.building where buildingID = '" + rset2.getString(1) + "'");
            while (rset3.next()){
            building = rset3.getString(1);
            roomNumber = rset2.getInt(2); 

            }
          }
            year = rset.getString(2);
                StringBuilder terms = new StringBuilder();
            if (rset.getInt(3) == 1) {
            terms.append("I,");
            }
            if (rset.getInt(4) == 1) {
            terms.append("II,");
            }
            if (rset.getInt(5) == 1) {
            terms.append("III");
            }
            String room = building + " " + roomNumber;
            String newRow[] = {year, room, terms.toString()};
            assignments.add(newRow);
        }
            Object columns[] = {"Year","Room","Terms"};
            Object[][] tabledata = new Object[assignments.size()][3];
            //String[assignments.size()][3] data;
            
            for (int i=0;i<assignments.size();i++)
            {
               tabledata[i] = assignments.get(i); 
            }
                    assignmentTable.setModel(new javax.swing.table.DefaultTableModel(tabledata, columns));
            
         //   assignmentTable.setModel(model);
        //   assignmentTable.setColumnModel(String[] columnNames = {"Year", "Room", "Terms"});
        
        } catch (SQLException ex) {
            Logger.getLogger(DORMS.class.getName()).log(Level.SEVERE, null, ex);
        }
                       
        assignedRoomsToStudent.setVisible(true);
        assignedRoomsToStudent.pack();    }

}
